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

Username:   Password: 
 RegisterRegister   
 Problems with Code
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh pageAdd this topic to your bookmarks (CTRL-D) View next topic
Author Message
sudhanva




PostPosted: Sat Jan 16, 2010 8:21 pm   Post subject: Problems with Code

var multiple_choice_answer : int
% Ask the multiple choice question
put "1. How many provinces and territories does Canada have?"
put " (1) 10 "
put " (2) 7 "
put " (3) 13 "
put " (4) None, Canada is just one big country "
% get the answer from your user
put " Please input your answer here : " ..
get multiple_choice_answer

for the answer if i put, 3 4 5 , it will input 3 for this question then move onto the next question and input 4 and then next question and input 5....

How do i stop this? *** There are spaces in between 3 , 4 and 5
Turing 4.0.5
 
Sponsor
Sponsor
Sponsor
sponsor
ProgrammingFun




PostPosted: Sun Jan 17, 2010 8:24 am   Post subject: RE:Problems with Code

You could use the if else structure and/or change the variable type into char (only one character input).
 
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh pageAdd this topic to your bookmarks (CTRL-D) View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: