Question
Write a C++ program that will ask a user for a pay rate and number of hours worked, then calculate and display the gross pay
Write a C++ program that will ask a user for a pay rate and number of hours worked, then calculate and display the gross pay based on those values (seem familiar?). The program should contain two functions, printDescription and calculateGrossPay. You may use more functions if you want, but these two are required. printDescription will display a program description (i.e. the "hello" message). This function should take no arguments and should return no results (void). calculateGrossPay will calculate the gross pay. The function should take two double arguments (rate and hours) and return the gross pay (double). Pseudocode for main() might be as follows: Call printDescription to show "hello" message Prompt user for rate and hours Call calculateGrossPay and assign result to grossPay Display results Display "goodbye" message //LIBRARIES (#includes) //PROTOTYPES //MAIN PROGRAM //DEFINITIONS Your style does matters
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