dtaylor01
Programmer
- Oct 14, 2008
- 2
Can someone take a look at my code. I'm having some errors and do not know how to correct. Not looking for someone to give me the answer, but walk me though to better understand.
This is a compiler to compute wages.
This is a compiler to compute wages.
Code:
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[ ])
{
int a = 40; //No. of hrs worked during week
float b = 12.75; //Pay rate: dollars per hour
float c = 510;
cout << a * b;
cout << c;
//Weekly 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
sum = (number of hours * pay rate);
// display the result
cout << endl;
cout << "The weekly wages are: $" << wages << endl;
return (0); // terminate with success
}