Answered step by step
Verified Expert Solution
Link Copied!

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: 1. Display Enter number of employees: 1a. Get number of employees (n) as input. 2. Set up a "for" loop (1 to n) Note: Use arrays to store annualSalary(double), maritalStatus(string) and netSalary(double) 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 $12000) c. Display averageTax (with a $ sign in front ie $1200) Create a function called CalculateFederalTax Input parameters for this function: annual salary(double) and marital status (string) Function output will be: taxAmount Use the below table to calculate the tax percentage. Tax Single Married 10% $0 to $11,000 $0 to $22,00012% $11,001 to $44,725 $22,001 to $89,45022% $44,726 to $95,375 $89,451 to $190,75024% $95,376 to $182,100 $190,751 to $364,20032% $182,101 to $231,250 $364,201 to $462,50035% $231,251 to $578,125 $462,501 to $693,75037% $578,126 or more $693,751 or more taxAmount = taxPercent * annualSalary Example: status=S annualSalary=55000 tax calculation (simplified) taxPercent =22%

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions