Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Refer to the exercise on page 328 #6.10 to calculate and display wages Make the following changes to the program: Add a function to display

image text in transcribed

  1. Refer to the exercise on page 328 #6.10 to calculate and display wages

Make the following changes to the program:

  1. Add a function to display a heading, and call the function from function main.
  2. Remove the assignment statement to calculate the wages currently found in function main.
  3. Add a function CalcWages to calculate the wages. Make the appropriate function call from the function main. The calculated wages will be returned to function main.
  4. Complete the function ShowDollars which will display the calculated wages with appropriate messages. The output should be well formatted.
  5. Complete the program with the changes. Write the required comments. Each function will have a block comment before the function header.
6.10 The following program skeleton asks for the number of hours you've worked and your hourly pay rate. It then calculates and displays your wages. The function showDollars, which you are to write, formats the output of the wages. #include using namespace std; void showDollars (double); // Function prototype int main() { double payRate, hoursWorked, wages; cout > hoursWorked; cout > payRate; wages = hoursWorked * payRate; showDollars (wages); return 0; } 1/ You must write the definition of the function showDollars 1/ here. It should take one parameter of the type double. 1/ The function should display the message "Your wages are $" 11 followed by the value of the parameter. It should be displayed 11 with 2 places of precision after the decimal point, in fixed 1/ notation, and the decimal point should always display

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

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions