Post a New Question

computer science

posted by .

Can you help me break this into two clases, and Employee class and the default program class? I have to include a mutator and accessor method and provide properties for the instance variables.



namespace commission
{
class Program
{


static void Main(string[] args)
{

decimal commission = 0.07M;
decimal federaltax = 0.18M;
decimal retirement = 0.10M;
decimal socialsecurity = 0.06M;

decimal commission_amt = 0;
decimal fed_t_amt = 0;
decimal retire_amt = 0;
decimal ss_amt = 0;
decimal total_amt = 0;
decimal moneytakenout_amt = 0;
decimal takehomepay = 0;
string employeeName;


Console.Write("Enter employee name: ");
employeeName = Console.ReadLine();

Console.Write("Enter the total sales amount for the week: ");
total_amt = Convert.ToDecimal(Console.ReadLine());

commission_amt = total_amt * commission;
fed_t_amt = federaltax * total_amt;
retire_amt = retirement * total_amt;
ss_amt = socialsecurity * total_amt;

moneytakenout_amt = retire_amt + fed_t_amt + ss_amt;
takehomepay = total_amt - moneytakenout_amt;

Console.WriteLine(commission_amt);
Console.WriteLine(fed_t_amt);
Console.WriteLine(retire_amt);
Console.WriteLine(ss_amt);
Console.WriteLine(takehomepay);

}
}
}

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Computer Science - Java

    Hi, For an assignment I am doing, we have to have 2 service classes and one application class. One service class is already written (i.e. DiceGame1) and I am writing another one (i.e. Player) that is supposed to use the previous service …
  2. computer science

    I need to see if someone can help me with a c# programming problem Create a class called employees that includes three pieces of information as either instance variables or automatic properties - a first name(type string), a last name …
  3. programming

    write a program in C# that calculates and prints the take home pay for a commissioned sales employee. allow the user to enter values for the name of the employee and the sales amount for the week. employee receives 7% of the total …
  4. computer science

    Hi what are mutator and accessor methods and what is the difference
  5. Programming II

    Create a test program that defines and uses both the default and non-default constructor of a class. Create a class of students in a college. Make sure you include name, phone number, student number, current course, current GPA, and …
  6. Computer Science

    I got part one but part 2 is confusing. Part1: Create a class called Person that has two subclasses Student and Employee. Make Faculty and Staff subclasses of Employee. A person has name and address. A student has GPA as a real number …
  7. COMPUTER SCIENCE JAVA

    Assignment problems: Write Java programs for each of the following. 1. Students in a university class are being organized into groups of three for an upcoming research project. To model this situation: a. Write a Student class that …
  8. COMPUTER SCIENCE JAVA

    Assignment problems: Write Java programs for each of the following. 1. Students in a university class are being organized into groups of three for an upcoming research project. To model this situation: a. Write a Student class that …
  9. computer science

    Write a method main that demonstrates class Employee's capabilities by creating two Employee objects. Initialize one of the objects (give values to the instance variables) using the constructor and display its instance variable values …
  10. computer science

    Mr Ali has given a test to his class. He would like to have the average score for the class as well as the highest and lowest scores. Write a pseudocode to calculate and display these values. Then convert your pseudocode into a program …

More Similar Questions

Post a New Question