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

Write a C# program that includes a Employee class that can be used to calculate

ID: 3887474 • Letter: W

Question

Write a C# program that includes a Employee class 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%. 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

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace hvaletskichapter4problem9 { class Employee { string name; int sales; Employee() { } public Employee(string a, string b) { name = a; sales= int.Parse(b); } public void Name(string inValue) { this.name = inValue; } public int Sales(string commision) { sales = int.Parse(commision); return sales; } public override string ToString() { string a = "Sales: "+sales+" Employee: " + name + " Commission Earning: " + sales * .07; string b =" "+"Federal Tax: "+(sales*.18)/100+" Social Security: "+(sales*.06)/100+" Retirement: "+(sales*.1)/100; string c = " Sales - Taxes: "+sales+" - "+sales*.34+" Take Home Pay: "+(sales-sales*.34); return a+b+c; } //Include at least one mutator and one accessor method; provide properties for the other instance variables. //Use appropriate constants, design an object-oriented solution, and write constructors. //All employees receive 7% of the total sales. //Federal tax rate is 18%. //Retirement contribution is 10%. //Social Security tax rate is 6%. } }

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