
-----------------------------------
pink00rock
Sat Feb 07, 2004 1:37 pm

HELP! multiple choice..
-----------------------------------
hii! i'm having trouble creating multiple choice on turing. well it is somewhat easy, its just i have to give the user a 2nd chance if they get it wrong. This is what i have so far.  :) 

var answer:string
var counter:int:=0

put "How many months are there in a year?"
put "a) 14"
put "b) 12"
put "c) 7 "
put "Please enter either a,b, or c." 
get asnwer
if answer = a or answer = A then
put "CORRECT!"
counter=: counter + 1  
end if 
put "The number of right answer is, " counter

Thank you so much :D

Mod Edit: Do post in the right forum next time...
Moved.

-----------------------------------
santabruzer
Sat Feb 07, 2004 1:39 pm


-----------------------------------
wrong place but meh.. here is some help.. enjoy my complex multiple choice program:
[url=http://www.compsci.ca/v2/viewtopic.php?p=31080#31080]Santa's Program!!!

-----------------------------------
santabruzer
Sat Feb 07, 2004 1:41 pm


-----------------------------------
and here's a mod of your code for you need  :roll: 

var answer : string
var counter : int := 0

for i : 1 .. 2
    put "How many months are there in a year?"
    put "a) 14"
    put "b) 12"
    put "c) 7 "
    put "Please enter either a,b, or c."
    get answer
    if answer = "b" or answer = "B" then
        put "CORRECT!"
        counter := counter + 1
        exit
    end if
end for
put "The number of right answer is, ", counter


-----------------------------------
.hack
Sat Feb 07, 2004 2:26 pm


-----------------------------------
u spelt answer wrong on one of the lines. thats prolly ur problemo

-----------------------------------
pink00rock
Sat Feb 07, 2004 3:07 pm


-----------------------------------
wow, thank you soooooo much! i forgot about that! wow! thanks people! well bye for now.. -take care 
p.s sry for posting in the wrong place.. its just that i'm a newbie.. just signed up today lol. thanks! bye
