Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

My C++ calculator


ghost's Avatar
0 0

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.


ghost's Avatar
0 0

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.


ynori7's Avatar
Future Emperor of Earth
0 0

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.


spyware's Avatar
Banned
0 0

MoshBat wrote: Start > [All Programs >] Accessories > Calculator.

Someone had to say it.

echo '%MATH%' | bc


elmiguel's Avatar
Member
2,795 1

Start > Run > calc > enter. =]


elmiguel's Avatar
Member
2,795 1

Touché! nice


spyware's Avatar
Banned
0 0

win+r, 'calc', enter.

Fuck mice.


spyware's Avatar
Banned
0 0

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.


elmiguel's Avatar
Member
2,795 1

One more…. Quick Launch Shortcut.


ghost's Avatar
0 0

from web browser javascript:alert(math); enter


p4plus2's Avatar
Member
0 0

If you are using firefox:

ctrl-k (move cursor to google search) type: 2+2 enter


spyware's Avatar
Banned
0 0

p4plus2 wrote: If you are using firefox:

ctrl-k (move cursor to google search) type: 2+2 enter

Tin foil hat /etc


korg's Avatar
Admin from hell
0 0

No, last one create hotkey in properties. Ctrl + Alt + C.


korg's Avatar
Admin from hell
0 0

OR give up on math and look at porn. :) Hit hotkey to media player.


elmiguel's Avatar
Member
2,795 1

Wow this thread got way off topic. =]