Need help with errors please

*********************************************************************************************************************************
//PROGRAM 1: WAGES

//CSS 110

//This program will calculate and display the weekly pay, given the standard wage amount and the number of hours of overtime.
*********************************************************************************************************************************

#include <iostream> //For cin and cout
#include <iomanip> //For setprecision
using namespace std;

//DECLARE CONSTANTS
const double RATE= 8.25; //$8.25 PER HOUR
const int HOURS=40; //NUMBER OF HOURS WORKED

int main ()
{
double money= RATE * HOURS;
cout << setiosflags (ios::fixed | ios::showpoint) << setprecision (2);
cout << "The weekly pay for this person is" << money << endl;

return 0;

}


Above is the code used to solve PROGRAM 1:

Wages are paid at a standard hourly rate for 40 hours per week and at time and one half for overtime. Write a C++ program that calculates and displays the weekly pay, given the standard wage amount and the number of hours of overtime as inputs.

Note:
Include a program message explaining the objective of the program to the user.
When displaying results to the screen, include explanations so that the user understands what s/he sees.
Display dollar amounts as currency using $ and two decimal places.
Use the following instruction at the start of your output to display real numbers with two decimal places.

cout << setiosflags (ios::fixed | ios::showpoint) << setprecision (2);


....................Would love some help in figuring out how far off I am. Thank you.
Last edited on
@somegreendayfan

Program 1, not fully solved, according to the criteria in your note.

Include a program message explaining the objective of the program to the user.
When displaying results to the screen, include explanations so that the user understands what s/he sees.
Display dollar amounts as currency using $ and two decimal places.
Use the following instruction at the start of your output to display real numbers with two decimal places.


1> Include a program message explaining the objective of the program to the user.

Have a sentence print telling what the program will show. Something like.. "This program will take the amount of hours worked, and show the total amount earned, by multiplying the Hours by the hourly wage the worker is earning."

2> When displaying results to the screen, include explanations so that the user understands what s/he sees.

You tell the amount earned, but that isn't really the objective. Maybe more like "Working for " << HOURS << " hours, at the earning rate of $" << RATE << " per hour, gives the worker a total of $" << money << " per week."

3> Display dollar amounts as currency using $ and two decimal places.

You never showed any dollar signs, plus you should put a space after the 'is', in ".. person is", so the numbers are set apart from the sentence. See the $ displayed in above under #2
@whitenite1

Thank you very much for your input, i am extremely knew to this C++ stuff, and my professor is not the best at explaining or demonstrating things...so I am basically on my own. I am still unsure of why there are errors, but there are...I am just unsure of what to do next...i made the changes i thought i should and ended with this....


#include <iostream> //For cin and cout
#include <iomanip> //For setprecision
using namespace std;

//DECLARE CONSTANTS
const double RATE= 8.25; //$8.25 PER HOUR
const int HOURS=40; //NUMBER OF HOURS WORKED

int main ()
{
double money= RATE * HOURS;
cout << setiosflags (ios::fixed | ios::showpoint) << setprecision (2);
cout << "Working for" <<HOURS<<"hours, at the earning rate of $" << RATE << "per hour, gives the worker a total of $" << money << "per week."; endl;
return 0;

}

but i am still ending up with these errors:
error C2062: type '__w64 unsigned int' unexpected
warning C4551: function call missing argument list
You have a syntax error in this line:

cout << "Working for" <<HOURS<<"hours, at the earning rate of $" << RATE << "per hour, gives the worker a total of $" << money << "per week."; endl;

Topic archived. No new replies allowed.