Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program in C++ using functions that enables the clerk to calculate employee gross pay based on the hours worked by its employees. The
Write a program in C++ using functions that enables the clerk to calculate employee gross pay based on the hours worked by its employees. The program has the following functions: 1. double getHours Worked(); returns the number of hours worked by the employee entered by the clerk. 2. double getPayRate(); returns the pay rate for its employee entered by the clerk. 3. double calcGross(double hours, double rate); returns the gross pay which is calculated by multiplying hours and rate. Required 1. Write the main program i.e the int main() for the program that will call the functions in order to calculate the gross pay. Declare appropriate variables in use and use correct method of calling functions. 2. Modify the above main program using a while loop so that the program repeats itself until the hours worked entered is a negative number. Sample output without while loop Hours worked : 50 Pay rate: 10 Gross pay: $500.00 Press any key to continueSample output with while loop Hours worked (negative number to end): 50 Pay rate: 10 Gross pay: $500.09 Hours worked
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