Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The goal of this lab is to calculate the net income for employees. This should work for n number of employees where n
The goal of this lab is to calculate the net income for employees. This should work for n number of employees where n is an input. In main.cs do the following: Display Enter number of employees: a Get number of employees n as input. Set up a "for" loop to n Note: Use arrays to store annualSalarydouble maritalStatusstring and netSalarydouble Inside the loop: a Get annual salary as input and store in a variable called annualSalary b Get marital status as input and store in a variable called status Note: valid values are M which means Married,"S which means Single c Call the function CalculateFederalTax with input as annualSalary and status. Function will return total tax payable. Store this in a variable called taxAmount. d Subtract taxAmount from annualSalary and store to a variable called netSalary e Display annualSalary, taxAmount and netSalary with $ sign in front Outside the loop: a Calculate average annualSalary and average taxAmount b Display averageSalary with a $ sign in front ie $ c Display averageTax with a $ sign in front ie $ Create a function called CalculateFederalTax Input parameters for this function: annual salarydouble and marital status string Function output will be: taxAmount Use the below table to calculate the tax percentage. Tax Single Married $ to $ $ to $ $ to $ $ to $ $ to $ $ to $ $ to $ $ to $ $ to $ $ to $ $ to $ $ to $ $ or more $ or more taxAmount taxPercent annualSalary Example: statusS annualSalary tax calculation simplified taxPercent
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started