Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to figure out this problem

Status
Not open for further replies.

gil600221

Programmer
Mar 8, 2009
1
US
Hi,

I have some errors when debugging the following code in C++. Does anyone have a suggestion on the correct code to use?

Thanks

#include <iostream>

using namespace std ;

int main()

{

int hours_worked ;
float pay_rate ;
float wages;

// read in the hours worked

cout << endl ;
cout << "Number of hours worked during"
<< " the week (integer) = " ;
cin >> hours_worked ;

// read in the pay rate

cout << "Hourly pay rate (specify two digits "
<< "after the decimal point) = " ;
cin >> pay_rate ;

// compute wages

write assignment statement to compute wages ;

// display the result

cout << endl ;
cout << "The weekly wages are: $" << wages << endl ;

return (0); // terminate with success
 
Correct your comment
Code:
   [COLOR=red]//[/color] write assignment statement to compute wages ;
and don't forget to mark the end of the main()
Code:
    return (0); // terminate with success 
[COLOR=red]}[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top