Computer Science Canada

Problems with Code

Author:  sudhanva [ 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

Author:  ProgrammingFun [ 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).


: