I need to use mutator and accessor methods and two classes but Im not sure where to start. I have the code working as is but I havent met the requirements.
Code:using System; using System.Collections.Generic; using System.Linq; using System.Text; 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 total_amt = 0; decimal commission_amt = 0; decimal fed_t_amt = 0; decimal retire_amt = 0; decimal ss_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: " + commission_amt); Console.WriteLine("Federal Tax: " + fed_t_amt); Console.WriteLine("Retirement: " + retire_amt); Console.WriteLine("Social Security: " + ss_amt); Console.WriteLine("Take Home Pay: " + takehomepay); } } }


Reply With Quote

Bookmarks