| Author |
My C++ calculator |
chronicburst
Member
Posts: 466
Location: /root/
Joined: 03.01.08 Rank: Elite |
|
Hey guys. I am using c++ to make a calculator, I am pretty much done.
I have 4 cases and if the user tries another case other than 1, 2, 3, or 4, I want a string to be looped.
However I cannot find a looping tutorial I can link to this. It would look something like this:
if case 1....
if case 2..
if case 3..
if case 4..
else **loop opt**
Im stuck on loops. Could anyone be of help please?
I want to make this a loop:
cout << opt;
cin >> a;
______
Hey what do ya know, I did it.
Edited by chronicburst on 04-08-09 16:16 |
|
| Author |
RE: My C++ calculator |
Raiden
Member
Posts: 3
Location:
Joined: 30.11.08 Rank: Moderate |
|
I don't understand what you're trying to do... Why would you want to loop a string if they're wrong? Couldn't you just display the option menu? Or are you looping the menu? Because that would be dumb.
Anyways, just look up the syntax for a C++ loop. Should be simple enough. Or you could just post what you're trying. That would make it easier to troubleshoot. |
|
| Author |
RE: My C++ calculator |
ynori7
Future Emperor of Earth

Posts: 1481
Location: #valhalla
Joined: 08.10.07 Rank: Diabolical |
|
Are you trying to make the program display the "please select an option" menu until the user selects a valid option? If so, look up the do-while loop. I can't imagine that you'd have a hard time finding any useful information about that.
|
|
| Author |
RE: My C++ calculator |
spyware
Member

Posts: 4190
Location: The Netherlands
Joined: 14.04.07 Rank: God Warn Level: 90
|
|
|
MoshBat wrote:
Start > [All Programs >] Accessories > Calculator.
Someone had to say it.
echo '%MATH%' | bc

"The chowner of property." - Zeph Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term. - Carl Sagan Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor? - Ebert |
|
| Author |
RE: My C++ calculator |
elmiguel
Member

Posts: 132
Location: Your Computer
Joined: 12.12.07 Rank: God |
|
Start > Run > calc > enter. =]
The philosophy of one century is the common sense of the next. -Fortune Cookie
I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor
|
|
| Author |
RE: My C++ calculator |
elmiguel
Member

Posts: 132
Location: Your Computer
Joined: 12.12.07 Rank: God |
|
Touchι! nice
The philosophy of one century is the common sense of the next. -Fortune Cookie
I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor
|
|
| Author |
RE: My C++ calculator |
spyware
Member

Posts: 4190
Location: The Netherlands
Joined: 14.04.07 Rank: God Warn Level: 90
|
|
win+r, 'calc', enter.
Fuck mice.

"The chowner of property." - Zeph Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term. - Carl Sagan Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor? - Ebert
Edited by spyware on 04-08-09 23:15 |
|
| Author |
RE: My C++ calculator |
spyware
Member

Posts: 4190
Location: The Netherlands
Joined: 14.04.07 Rank: God Warn Level: 90
|
|
|
MoshBat wrote:
From desktop, presuming shortcut:
Space, calc, Enter.
Bullshit solution :]. And people with icons on their desktops, (or people running the standard explorer.exe shell) are ghey. Yes, you heard me, ghey.

"The chowner of property." - Zeph Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term. - Carl Sagan Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor? - Ebert |
|
| Author |
RE: My C++ calculator |
elmiguel
Member

Posts: 132
Location: Your Computer
Joined: 12.12.07 Rank: God |
|
One more.... Quick Launch Shortcut.
The philosophy of one century is the common sense of the next. -Fortune Cookie
I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor
|
|
| Author |
RE: My C++ calculator |
Zkunxen
Member
Posts: 47
Location:
Joined: 24.07.09 Rank: Elite |
|
from web browser
javascblockedript:alert(math);
enter
|
|
| Author |
RE: My C++ calculator |
p4plus2
Member
Posts: 167
Location:
Joined: 31.03.08 Rank: God |
|
If you are using firefox:
ctrl-k (move cursor to google search)
type: 2+2
enter
"You can't be something your not,
Be yourself by yourself
Stay away from me" ~Walk, Pantera
"Playing an acoustic guitar is like having sex with your clothes on" ~Dave Mustaine |
|
| Author |
RE: My C++ calculator |
spyware
Member

Posts: 4190
Location: The Netherlands
Joined: 14.04.07 Rank: God Warn Level: 90
|
|
|
p4plus2 wrote:
If you are using firefox:
ctrl-k (move cursor to google search)
type: 2+2
enter
Tin foil hat
/etc

"The chowner of property." - Zeph Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term. - Carl Sagan Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor? - Ebert |
|
| Author |
RE: My C++ calculator |
korg
Admin from hell

Posts: 1704
Location: ENDING YOUR ONLINE EXPERIENCE!
Joined: 01.01.06 Rank: The Master |
|
No, last one create hotkey in properties. Ctrl + Alt + C.
I deal in pain, All life I drain, I dominate, I seal your fate.
|
|
| Author |
RE: My C++ calculator |
korg
Admin from hell

Posts: 1704
Location: ENDING YOUR ONLINE EXPERIENCE!
Joined: 01.01.06 Rank: The Master |
|
OR give up on math and look at porn. Hit hotkey to media player.
I deal in pain, All life I drain, I dominate, I seal your fate.
|
|
| Author |
RE: My C++ calculator |
elmiguel
Member

Posts: 132
Location: Your Computer
Joined: 12.12.07 Rank: God |
|
Wow this thread got way off topic. =]
The philosophy of one century is the common sense of the next. -Fortune Cookie
I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor
|
|