subject

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, 29.01.2019 16:38
How to launch an app: steps to be successful? launching an app is a great idea, but it’s not that easy as we supposed to think. the majority of mobile applications don’t generate revenue because companies aren’t ready to be competitive. referring to our experience in successfully building and launching apps we hope to you omit these difficulties. we are going to talk about ideas, marketing, testing your product, its development, distribution and support. you will learn 8 product launch stages to succeed.
Answers: 1
question
Computers and Technology, 23.01.2019 04:20
Append and make table queries are called queries. select complex simple action i think action
Answers: 1
question
Computers and Technology, 22.01.2019 21:40
In an access report, which view should you use if you want to change the margins of the report? report view print preview layout view design view
Answers: 1
question
Computers and Technology, 20.01.2019 00:25
What is a number system, and what is the total number of digits used in this system called? a number system is a system that uses different (options: a) numbers b) symbols c) codes d) digits e) alphabets) to represent different numbers. the total number of digits used in a number system is known as its (options: 1) processor 2) converter 3) radix 4) least significant digit 5) most significant digit)
Answers: 1
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.11.2016 16:40
question
Mathematics, 18.02.2017 22:06
question
Mathematics, 01.08.2018 11:31
Questions on the website: 6551834