Image

Imageholdmefaster wrote in Imagecpp

Beginning C++ user

Hey guys. I wrote this C++ program, but it stops about halfway through the program. It computes the amount of each three days, but then it wont compute or print anything once you get to the "weekhours" and "weektotal" statements or the if else statements, but it looks like I wrote everything correctly and I have the variables declared. Can anyone help me out?? For a second I got the week hours cout statement to print, then it went away for some reason.


Here is the code:




#include
[Error: Irreparable invalid markup ('<iostream.h>') in entry. Owner must fix manually. Raw contents below.]

Hey guys. I wrote this C++ program, but it stops about halfway through the program. It computes the amount of each three days, but then it wont compute or print anything once you get to the "weekhours" and "weektotal" statements or the if else statements, but it looks like I wrote everything correctly and I have the variables declared. Can anyone help me out?? For a second I got the week hours cout statement to print, then it went away for some reason.


Here is the code:

<lj-cut>


#include<iostream.h>


int main()
{
float dayonehours, dayonewage, dayonetotal, daytwohours, daytwowage, daytwototal, daythreehours, daythreewage, 7daythreetotal, totalweek, weekhours;

cout<< "Please type in Day 1 hours: ";
cin >> dayonehours;
cout << "Please type in hourly wage: ";
cin >> dayonewage;
dayonetotal = (dayonewage*dayonehours);
cout << " Total amount earned for " << dayonehours << " hours is $ " << dayonetotal << endl;


cout<< "Please type in Day 2 hours: ";
cin >> daytwohours;
cout << "Please type in hourly wage: ";
cin >> daytwowage;
daytwototal = (daytwowage*daytwohours);
cout << " Total amount earned for " << daytwohours << " hours is $ " << daytwototal << endl;

cout << "Please type in Day 3 hours: ";
cin >> daythreehours;
cout << "Please type in hourly wage: ";
cin >> daythreewage;
daythreetotal = (daythreewage*daythreehours);
cout << " Total amount earned for " << daythreehours << " hours is $ " << daythreetotal << endl;

weekhours=(dayonehours+daytwohours+daythreehours);
cin>>weekhours;
cout<< "Total hours worked for the week is "<<weekhours<<endl;

weektotal=(dayonetotal+daytwototal+daythreetotal);
cin>>weektotal;
cout<<"The total earned for the week is $"<<weektotal<<endl;

if(weektotal>150.00)
cout<< "Go to see a movie Saturday evening; and have a good dinner in favorite eatery.\n';
else if(weektotal<=150.00 & weektotal>100.00)
cout<< "Go to see movie Saturday afternoon; Have a hamburger for dinner at Mcdonald.\n"
else if(weektotal<100)
cout<<"Watch football game UM vs. MSU at home; and have a home-made sandwich.\n"
else
cout<<"No TV/movie over weekend"<<endl;

if(weekhours>15.0)
cout<<"No Tv/movie or weekend"<<endl;


system("pause")
return 0;
}


</lj-cut>


Thanks so much if you can help.