Computer Science Canada

HELP! multiple choice..

Author:  pink00rock [ Sat Feb 07, 2004 1:37 pm ]
Post subject:  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. Smile

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 Very Happy

Mod Edit: Do post in the right forum next time...
Moved.

Author:  santabruzer [ Sat Feb 07, 2004 1:39 pm ]
Post subject: 

wrong place but meh.. here is some help.. enjoy my complex multiple choice program:
Santa's Program!!!

Author:  santabruzer [ Sat Feb 07, 2004 1:41 pm ]
Post subject: 

and here's a mod of your code for you need Rolling Eyes

code:
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

Author:  .hack [ Sat Feb 07, 2004 2:26 pm ]
Post subject: 

u spelt answer wrong on one of the lines. thats prolly ur problemo

Author:  pink00rock [ Sat Feb 07, 2004 3:07 pm ]
Post subject: 

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


: