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

Username:   Password: 
 RegisterRegister   
 HELP! multiple choice..
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
pink00rock




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
santabruzer




PostPosted: Sat Feb 07, 2004 1:39 pm   Post subject: (No subject)

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




PostPosted: Sat Feb 07, 2004 1:41 pm   Post subject: (No 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
.hack




PostPosted: Sat Feb 07, 2004 2:26 pm   Post subject: (No subject)

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




PostPosted: Sat Feb 07, 2004 3:07 pm   Post subject: (No 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
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  [ 5 Posts ]
Jump to:   


Style:  
Search: