Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed
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

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

Step: 3

blur-text-image

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions