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.
This is a discussion on Anyone interested in helping me out again?? within the C++ Programming forums, part of the General Programming Boards category; Mmm, yeah. It's a good way to look even less like you know what you're doing... might want to get ...
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.
Sent from my iPad®
Do you speak from experience? . . .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; }
Last edited by dwks; 10-03-2007 at 01:34 PM.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
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
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.