Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that includes an Employee class in C# that can be used to calcul

ID: 3676145 • Letter: W

Question

Write a program that includes an Employee class in C# that can be used to calculate and print the take-home pay for a commissioned sales employee. All employees receive 7% of the total sales. Federal tax rate is 18%. Retirement contribution is 10%. Social Security tax rate is 6%. Write instance methods to calculate the commission income, federal and social security tax withholding amounts and the amount withheld for retirement. Use appropriate constants, design an object-oriented solution, and write constructors. Include at least one mutator and one accessor method; provide properties for the other instance variables. Create a second class to test your design. Allow the user to enter values for the name of the employee and the sales amount for the week in the second class.

Explanation / Answer

Console.WriteLine("What are your weekly sales?"); try { Int32 weeklySales = Int32.Parse(Console.ReadLine()); Double grossPay = weeklySales * .07; Double fedTax = grossPay * .18; Double retirement = grossPay * .1; Double socSecurity = grossPay * .06; Double totDeductions = socSecurity + retirement + fedTax; Double takeHomePay = grossPay - totDeductions; Console.Write(" Your Weekly Sale amount is :" + weeklySales + "$ Gross Pay: " + grossPay + "$ Fed Tax: " + fedTax + "$ Retirement: " + retirement + "$ Social Security: " + socSecurity + "$ Total Deductions: " + totDeductions + "$ Making your take home pay: " + takeHomePay + "$"); Console.Read(); } catch { Console.WriteLine("There is an error in input. Program will be terminated."); }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote