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 <iostream> #include <iomanip> using namespace std;void showDollars(double pay); // Function prototype int main(){ double payRate, hoursWorked, wages;cout << "How many hours have you worked? " cin >> hoursWorked;cout << "What is your hourly pay rate? "; cin >> payRate;wages = hoursWorked * payRate; showDollars(wages);return 0; }// Write the definition of the showDollars function here.// It should have one double parameter and display the message // "Your wages are $" followed by the value of the parameter.
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 <iostream> #include <iomanip> using namespace std;
void showDollars(double pay); // Function prototype int main()
{
double payRate, hoursWorked, wages;
cout << "How many hours have you worked? " cin >> hoursWorked;
cout << "What is your hourly pay rate? "; cin >> payRate;
wages = hoursWorked * payRate; showDollars(wages);
return 0;
}
// Write the definition of the showDollars function here.
// It should have one double parameter and display the message // "Your wages are $" followed by the value of the parameter.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images