After following a book for some time ive started to use my head and do a few simple programs of my own, the one im have a problem with is listed below.
Basicly i want a user to enter a day, then the system says weather its the weekend or not. It it thinks its the weekend it will check this with the user , depending on what answer the user gives (yes/no) another msg will be displayed. If the user did not enter a weekend day the system will simply say its not the weekend for example.Code:#include<iostream> int main() { using std::cout; using std::cin; char day; cout << "What day is it: "; cin >> day; char reply; cin >> reply; if day = Saturday or Sunday; cout << "Its the weekend right?"; { if reply = yes; cout <<"SYS msg" ; char StopCharacter; cout << "Press a key and \"Enter\" to end: " ; cin >> StopCharacter; else { cout << "dont lie :-p. Its, " << day << "\n"; } } else cout << "SYS msg" "\n"; char StopCharacter; cout << "Press a key and \"Enter\" to end: " ; cin >> StopCharacter; return 0; }
Im have a problem compileing the program tho.
the compiler comes back with the following errors:
Error E2376 ddd.cpp 17: If statement missing ( in function main()
Error E2376 ddd.cpp 20: If statement missing ( in function main()
Error E2054 ddd.cpp 25: Misplaced else in function main()
Error E2054 ddd.cpp 31: Misplaced else in function main()
Error E2134 ddd.cpp 38: Compound statement missing } in function main()
Been trying to sort this out for a while now but i can't, any help would be appreciatedthanks
EDIT: im assuming that everytying else is ok cos i havent had a compile error else where yet. If theres other errors plz let me know![]()


LinkBack URL
About LinkBacks
thanks
Reply With Quote


)
only error i get now is with the If statement: