Mmm, yeah. It's a good way to look even less like you know what you're doing... might want to get a book.
Keep in mind, I'm in work waiting on reports, so this is my mean time. I'm much more friendly in my home hours.
Printable View
Mmm, yeah. It's a good way to look even less like you know what you're doing... might want to get a book.
Keep in mind, I'm in work waiting on reports, so this is my mean time. I'm much more friendly in my home hours.
Do you speak from experience? . . . ;)Quote:
They actually tend to report stuff to college professors. .
Perhaps you meant 'y' instead of y, and 'n' instead of 'n'? Besides, that logic is messed up.Code:while (toupper(quit[0]) != n || toupper(quit[0]) == y);
The second test is redundant . . .Code:while the letter is not n or the letter is y
You're still including conio.h, which is non-standard.
[edit]The output tends to be prettier if you print spaces around numbers. As written, the user will see something likeCode:cout << "It will take you" << numpayment_period << "months to pay of your mortgage." <<endl;
Also, the red of should be off.Code:It will take you12months to pay of your mortgage.
Looks to me like you can enter anything and the program will still quit . . . [/edit]Code:cout << "Enter Y to continue, N to quit>";
cin >> quit;
return 0;
}
Comparing lower-case letters to the result of toupper is almost certain to always be false, since toupper converts the letter to upper-case.
--
Mats