Function Practice Exercise: Employee Pay The goal of this exercise is to practice writing C++ functions by writing program that calculates the pay for an employee. This program will prompt for and read a pay rate number of hours worked from the user. It will then echo the input information and output the calculated pay. What to Do • Add code to template file ex2_calcPay.cpp in the replit team project or create it in your IDE. • write a void function, called getData(),which takes two arguments and reads the pay rate and the number of hours worked. • write a value returning function, called calcPay(), which takes two arguments and returns the total pay for that employee. • write a void function, called printPay(),which takes three arguments and prints the input information and the calculated total pay. • make use of parameters and returns to pass information around, do not use global variables. • The sample output for the program should looks like the following: This program calculates total pay for an employee. please enter pay rate per hour: 15.66 Please enter hours worked: 200.5 For an employee who worked 200.5 hours with a pay rate $ 15.66 per hour, The total pay is $ 3139.83. Press any key to continue. .. When you are done: • Take a screenshot of your IDE and console window after compiling and then running the program twice. The inputs that you can use are: 1. the pay rate and monthly hours of a job you expect to get soon 2. the pay rate and monthly hours of your dream job • For this exercise, you will have: ex2_calcPay.cpp. • If you have completed Exercises 1 and 2, congratulations! Option 1 is complete! Please download a zip file from replit and upload it to URCourses.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Function Practice Exercise: Employee Pay
The goal of this exercise is to practice writing C++ functions by writing program that calculates the pay for an employee. This program will prompt for and read a pay rate
number of hours worked from the user. It will then echo the input information and output the calculated pay.
What to Do
Add code to template file ex2_calcPay.cpp in the replit team project or create it in your IDE.
• write a void function, called getData(),which takes two arguments and reads the pay rate and the number of hours worked.
• write a value returning function, called calcPay(), which takes two arguments and returns the total pay for that employee.
• write a void function, called printPay(), which takes three arguments and prints the input information and the calculated total pay.
make use of parameters and returns to pass information around, do not use global variables.
• The sample output for the program should looks like the following:
This program calculates total pay for an employee.
please enter pay rate per hour: 15.66
Please enter hours worked: 200.5
For an employee who worked 200.5 hours with a pay rate $ 15.66 per hour,
The total pay is $ 3139.83.
Press any key to continue
When you are done:
• Take a screenshot of your IDE and console window after compiling and then running the program twice. The inputs that you can use are:
1. the pay rate and monthly hours of a job you expect to get soon
2. the pay rate and monthly hours of your dream job
For this exercise, you will have: ex2_calcPay.cpp.
• If you have completed Exercises 1 and 2, congratulations! Option 1 is complete! Please download a zip file from replit and upload it to URCourses.
Transcribed Image Text:Function Practice Exercise: Employee Pay The goal of this exercise is to practice writing C++ functions by writing program that calculates the pay for an employee. This program will prompt for and read a pay rate number of hours worked from the user. It will then echo the input information and output the calculated pay. What to Do Add code to template file ex2_calcPay.cpp in the replit team project or create it in your IDE. • write a void function, called getData(),which takes two arguments and reads the pay rate and the number of hours worked. • write a value returning function, called calcPay(), which takes two arguments and returns the total pay for that employee. • write a void function, called printPay(), which takes three arguments and prints the input information and the calculated total pay. make use of parameters and returns to pass information around, do not use global variables. • The sample output for the program should looks like the following: This program calculates total pay for an employee. please enter pay rate per hour: 15.66 Please enter hours worked: 200.5 For an employee who worked 200.5 hours with a pay rate $ 15.66 per hour, The total pay is $ 3139.83. Press any key to continue When you are done: • Take a screenshot of your IDE and console window after compiling and then running the program twice. The inputs that you can use are: 1. the pay rate and monthly hours of a job you expect to get soon 2. the pay rate and monthly hours of your dream job For this exercise, you will have: ex2_calcPay.cpp. • If you have completed Exercises 1 and 2, congratulations! Option 1 is complete! Please download a zip file from replit and upload it to URCourses.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education