subject
Computers and Technology, 02.12.2019 22:10

This program will be used by employees to determine what their weekly net pay
would be based on their hourly rate and number of hours worked.

use constant global variable to store the following value:
overtime_rate = 1.5

use constant local variables to store the following values:
union_dues = 10.00 fica_rate = 6% (0.06)
federal_rate = 15% (0.15) state_rate = 5% (0.05)

the user will be asked to input their hourly rate and number of hours worked.
the data entered will be validated.
the hourly rate must be between $10.00 - $15.00 inclusive (10-15).
the hours worked must be between 1 and 50 inclusive (1-50).
the program should then calculate gross and net pay using the user input and
constants provided.
for the hours over 40 the employee gets paid 1.5 times their rate.
in addition, the net hourly rate will also be calculated and displayed, so that
employees will know what their take-home pay per hour is.
the results should be displayed on the screen with an appropriate label
preceding the value.
the amounts should line up under each other after their labels (see sample output).
the rates used to calculate fica, federal, and state tax should be displayed
after each of the corresponding amounts.
the output should be formatted to two decimal points.


requirements:
source code file and sample output for each case.

you can choose your own variable names, but the function prototypes to use are:

double inputrate();
int inputhours();
double calcgross(double rate, int hours);
double calctax(double gross, double taxrate);

define the calctax function so that all three taxes can be calculated
by calling the same function three times:

fica = calctax(gross, fica_rate);
federal = calctax(gross, federal_rate);
state = calctax(gross, state_rate);


use these cases to test your program:

case # rate worked case # rate worked

1 12.50 40 2 15.00 45


sample output:

p05 - your name

enter a value between $10 and $15.00 for the hourly rate: 12.50

enter a value between 1 and 50 for the hours worked: 40

hourly rate: 12.50
hours worked: 40
gross pay: 500.00
fica tax: 30.00 at 0.06
federal tax: 75.00 at 0.15
state tax: 25.00 at 0.05
union dues: 10.00
net pay: 360.00
net hourly: 9.00

you!

press any key to continue



p05 - your name

enter a value between $10 and $15.00 for the hourly rate: 15

enter a value between 1 and 50 for the hours worked: 45

hourly rate: 15.00
hours worked: 45
gross pay: 712.50
fica tax: 42.75 at 0.06
federal tax: 106.88 at 0.15
state tax: 35.63 at 0.05
union dues: 10.00
net pay: 517.25
net hourly: 11.49

you!

press any key to continue


pseudocode:

//function prototypes

double inputrate();
int inputhours();
double calcgross(double rate, int hours);
double calctax(double gross, double taxrate);

void main()
{


}//end of main


//function definitions

double inputrate()
{
double rate;
do
{
prompt for and get rate

}while(rate is not valid)

return rate;
}


int inputhours()
{
int hours;
do
{
prompt for and get hours

}while(hours are not valid)

return hours;
}


double calcgross(double rate, int hours)
{
double gross;
if hours > 40
gross = overtime rate
else
gross = straight time

return gross;
}


double calctax(double gross, double taxrate)
{
double amount;
amount = gross * taxrate;
return amount;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 30.01.2019 20:21
The two main ways in which marketers address the competition with their strategies are by satisfying a need better than a competition and by
Answers: 2
question
Computers and Technology, 30.01.2019 05:29
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 27.01.2019 21:07
What does the level 1 topic in a word outline become in powerpoint? a. first-level bullet item b. slide title c. third-level bullet item d. second-level bullet item
Answers: 1
question
Computers and Technology, 23.01.2019 18:02
Need fast im timed in a paragraph of 125 words, explain at least three ways that engineers explore possible solutions in their projects.
Answers: 2
You know the right answer?
This program will be used by employees to determine what their weekly net pay
would be based...
Questions
question
Mathematics, 03.10.2019 18:54
question
Mathematics, 03.10.2019 18:54
question
Medicine, 03.10.2019 18:53
Questions on the website: 6713914