Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing Problem
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Satisfaction




PostPosted: Fri May 09, 2008 7:11 pm   Post subject: Turing Problem

I have created a program that asks 5 multiple choice question. It also displays the results. If you get one question right, you get one point. If I do the quiz more than once the results add up. I was wondering how you change the variable value back to 0 each time you do the quiz again.[/list]
Sponsor
Sponsor
Sponsor
sponsor
Asherel




PostPosted: Fri May 09, 2008 7:13 pm   Post subject: RE:Turing Problem

In your if statement set the varaible to 0.

Do this:

Turing:


if answer = true then %Or however your if statement goes
     results := 0
end if
[Gandalf]




PostPosted: Fri May 09, 2008 7:23 pm   Post subject: RE:Turing Problem

code:
var results : int
loop
    askQuestions %results are calculated here also
    results := 0
end loop

Though the simplicity of this problem causes me to think you might be asking something else? If not, a great place to learn all the basics is the Turing Walkthrough. Good luck.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: