Posted: 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
Asherel
Posted: 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 =truethen%Or however your if statement goes
results :=0 endif
[Gandalf]
Posted: 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.