0

sentinel code to run and stop program

I need this loop to work to start and stop program!!! I don't understand how to make it run my code. using namespace std; int main() { double monday, tuesday, wednesday, thursday, friday, NAT, saturday, sunday, totalHours, payrate, basePay, overtime; int d, m, y; char slash_dummy; int input = 1; //loop to start program while (input == 1) { cout << "press 1 to start program or 2 to end program ", cin >> input; input = 0; while (input < 1 || input < 2) { } cout << "input 1 if you want to try again." << endl; cout << "input 2 if you're done. " << endl; } cin >> input; if (input <1 || input >2) { cout << "that value is unacceptable try again. " << endl; } //code to program cout << "This program will calculate a single persons' net pay, gross pay, and total hours worked:\n"; cout << "The user must enter hours each day that they have worked, payrate,\n"; cout << "start of pay period, and end of pay period:\n" << endl; cout << "Enter pay rate: "; cin >> payrate; cout << endl; cout << "Enter starting pay period date: "; cin >> m >> slash_dummy >> d >> slash_dummy >> y; cout << endl; cout << "Pay week ends on thursday night at 12am " << "enter end of pay period date: "; cin >> m >> slash_dummy >> d >> slash_dummy >> y; cout << endl; cout << "Enter friday's date: "; cin >> m >> slash_dummy >> d >> slash_dummy >> y; cout << endl; cout << "Enter hours worked for friday: "; cin >> friday; cout << endl; cout << "Enter Saturday's date: "; cin >> m >> slash_dummy >> d >> slash_dummy >> y; cout << endl; cout << "Enter hours worked for saturday: "; cin >> saturday; cout << endl; cout << "Enter sunday's date: "; cin >> m >> slash_dummy >> d >> slash_dummy >> y; cout << endl; cout << "Enter hours worked for sunday: "; cin >> sunday; cout << endl; cout << "Enter monday's date: "; cin >> m >> slash_dummy >> d >> slash_dummy >> y; cout << endl; cout << "Enter hours worked for monday: ";

27th Jun 2017, 11:36 PM
Reginald Wright
Reginald Wright  - avatar
2 ответов
0
It would be easy and good practices for a programmer to set break points. if you want our suggestions please post the error report here..
29th Jun 2017, 2:34 AM
Nura Programmer
Nura Programmer - avatar
0
..\Playground\: In function 'int main()': ..\Playground\:23:8: error: expected ';' before '}' token } ^
1st Jul 2017, 4:54 AM
Reginald Wright
Reginald Wright  - avatar