Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/ * Exercises: 1 . Complete the program below. Sample Run: This program takes two numbers ( pay rate & hours ) and multiplies them
Exercises:
Complete the program below.
Sample Run:
This program takes two numbers pay rate & hours and
multiplies them to get gross pay. It then takes out
for taxes
Please input the pay per hour:
Please input the number of hours worked:
The gross pay is: $
The net pay is: $
This calculates a paycheck
#include Required for cin and cout
#include Required for setprecision
using namespace std; Required for not having to use std::
Function prototypes
void printDescription; void function with no parameters
void calculatePaycheckfloat int, float& float&; void function with parameters
The main function
int main
float payRate;
int hours;
float grossPay, netPay;
cout setprecision fixed; Set the precision of the output
printDescription; Call the description function
cout "Please input the pay per hour: ;
cin payRate;
cout "Please input the number of hours worked: ;
cin hours;
Call the calculatePaycheck function
TODO: Pass the payRate, hours, grossPay, and netPay
cout "The gross pay is: $ grossPay endl;
cout "The net pay is: $ netPay endl;
return ;
The function to print the description
void printDescription
cout "This program takes two numbers pay rate & hours and
;
cout "multiplies them to get gross pay. It then takes out
;
cout "for taxes
;
The function to calculate the paycheck
void calculatePaycheckfloat rate, int time, float& gross, float& net
gross rate time;
net gross ; tax
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