Join us at IRC!
It is never to LATE to become what you never WERE.
Thursday, May 24, 2012
Navigation
Members Online
Total Online: 30
Web Spiders: 18
Guests Online: 27
Members Online: 3

Registered Members: 70201
Newest Member: subnick
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

My C++ calculator

chronicburst
Member

Posts: 466
Location: /root/
Joined: 03.01.08
Rank:
Elite
Posted on 04-08-09 15:38
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
chronicburst at yahoo dot com http://hellboundhackers.org
Author

RE: My C++ calculator

Raiden
Member

Posts: 3
Location:
Joined: 30.11.08
Rank:
Moderate
Posted on 04-08-09 16:30
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
Posted on 04-08-09 16:38
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.




ynori7 http://halls-of-valhalla.org
Author

RE: My C++ calculator

spyware
Member



Posts: 4190
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 04-08-09 20:50
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
http://bitsofspy.net
Author

RE: My C++ calculator

elmiguel
Member



Posts: 132
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 04-08-09 21:51
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


<script>alert('XSS');</script>
Author

RE: My C++ calculator

elmiguel
Member



Posts: 132
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 04-08-09 22:33
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


<script>alert('XSS');</script>
Author

RE: My C++ calculator

spyware
Member



Posts: 4190
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 04-08-09 22:47
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
http://bitsofspy.net
Author

RE: My C++ calculator

spyware
Member



Posts: 4190
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 04-08-09 23:16
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
http://bitsofspy.net
Author

RE: My C++ calculator

elmiguel
Member



Posts: 132
Location: Your Computer
Joined: 12.12.07
Rank:
God
Posted on 05-08-09 11:26
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


<script>alert('XSS');</script>
Author

RE: My C++ calculator

Zkunxen
Member

Posts: 47
Location:
Joined: 24.07.09
Rank:
Elite
Posted on 06-08-09 05:53
from web browser
javascblockedript:alert(math);
enter


Author

RE: My C++ calculator

p4plus2
Member

Posts: 167
Location:
Joined: 31.03.08
Rank:
God
Posted on 06-08-09 08:24
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
p4plus2@hotmail.com
Author

RE: My C++ calculator

spyware
Member



Posts: 4190
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 06-08-09 08:25
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
http://bitsofspy.net
Author

RE: My C++ calculator

korg
Admin from hell



Posts: 1704
Location: ENDING YOUR ONLINE EXPERIENCE!
Joined: 01.01.06
Rank:
The Master
Posted on 06-08-09 09:50
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
Posted on 06-08-09 10:05
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
Posted on 06-08-09 13:10
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


<script>alert('XSS');</script>
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.