Computer Science Canada need help with assigment |
Author: | recyclebin123 [ Wed Mar 23, 2005 11:28 pm ] |
Post subject: | need help with assigment |
umm for my comp sci class i need to make a quiz thing that will ask the user for the capital of a province in canada and he will get 3 trys before moving on and if he or she gets it right the first time he gets 3 points and second guess he gets 2 points and 3rd guess he gets 1 point. Unfortunately i do not know how to do this. This is all i got so far......... var tor, quecity, vict, edm, reg, winni, stj, fred, hali : string var count : int := 0 put "Please answer with capital letters for first letter" put "You get THREE trys for each question" put "" put "" put "What is the capital of Ontario" loop count := count + 1 get tor if tor = "Toronto" then put "You are correct" else put "You are wrong. Please Try again" end if exit when count = 3 or tor = "Toronto" end loop put "" put "" put "What is the captial of Quebec" loop count := count+1 get quecity if quecity = "Quebec City" then put "You are correct" else put "Nope sorry. Youre Wrong" end if exit when count = 6 or quecity = "Quebec City" end loop This sort of works but i dun no how to do the points part and how to end it if the user were to get it rite on the second try or first. |
Author: | Naveg [ Wed Mar 23, 2005 11:34 pm ] | ||
Post subject: | |||
|
Author: | zylum [ Thu Mar 24, 2005 12:50 am ] | ||
Post subject: | |||
like this?
|
Author: | Mr. T [ Thu Mar 24, 2005 12:50 am ] | ||||
Post subject: | |||||
Since Quebec City is a string with two words, you need to make your get statement compatible.
Good Luck. |