Jump to content


Photo

Question


  • Please log in to reply
4 replies to this topic

#1 TWIXMIX

TWIXMIX
  • New Members
  • 5 posts

Posted 11 February 2004 - 07:58 PM

How can i make it so my calculator program restarts after you finish a question?

#2 hellfire

hellfire
  • New Members
  • 53 posts

Posted 11 February 2004 - 10:13 PM

a while statement would work, though I can't quite remember how they are eaxtly set up.

#3 Mastermind

Mastermind

    Server Technician

  • Undead
  • 7,014 posts
  • Location:Cambridge, MA
  • Projects:MasterNews 3
  •  The Man Behind the Curtain

Posted 11 February 2004 - 10:22 PM

do
{
   Code Statements;
}
while(condition);
That should be right, I'll check later.
Posted Image

Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.

Too cute! | Server Status: If you can read this, it's up |

#4 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 11 February 2004 - 10:49 PM

How can i make it so my calculator program restarts after you finish a question?

int Another = 1;

while ( Another )
{

<your code here>

cout << "Another go? Press 1 for Yes, 0 for No.";
cin >> Another;

}


While 'Another' is 1 the loop will keep going. When someone puts 0 the loop will finish.

#5 the_kid

the_kid

    L337 Pwnerer of N00bs

  • Project Team
  • 1,734 posts
  • Location:La$ Vega$, NV
  • Projects:freelancing between what interests me
  •  + TRIPLEhelix

Posted 12 February 2004 - 05:39 AM

actually I used teh goto

I'll post up my calculator now...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users