Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Ms.Nicosia
- %ICS20-01
- %Capitals of provinces
- %declaring variables
- var guess : string
- var tries:real:=0
- var right:int:=0
- %For command
- for times : 1 .. 3
- %Getting variable values
- put "What is the capital city of Ontario? (You only have 3 guesses) " ..
- get guess
- %if statement
- if guess = "Toronto" then
- right:=right+1
- put "Right!"
- exit
- else
- put "Sorry wrong answer."
- end if
- tries:=tries+1
- end for
- put " Tries: ", tries
- %For command
- for times : 1 .. 3
- %Getting variable values
- put "What is the capital city of Alberta? (You only have 3 guesses) " ..
- get guess
- %if statement
- if guess = "Edmonton" then
- right:=right+1
- put "Right!"
- exit
- else
- put "Sorry wrong answer."
- end if
- tries:=tries+1
- end for
- put " Tries: ", tries
- %For command
- for times : 1 .. 3
- %Getting variable values
- put "What is the capital city of Nova Scotia? (You only have 3 guesses) " ..
- get guess
- %if statement
- if guess = "Halifax" then
- right:=right+1
- put "Right!"
- exit
- else
- put "Sorry wrong answer."
- end if
- tries:=tries+1
- end for
- put " Tries: ", tries
- %For command
- for times : 1 .. 3
- %Getting variable values
- put "What is the capital city of Saskatchewan? (You only have 3 guesses) " ..
- get guess
- %if statement
- if guess = "Regina" then
- right:=right+1
- put "Right!"
- exit
- else
- put "Sorry wrong answer."
- end if
- tries:=tries+1
- end for
- put " Tries: ", tries
- %For command
- for times : 1 .. 3
- %Getting variable values
- put "What is the capital city of Manitoba? (You only have 3 guesses) " ..
- get guess
- %if statement
- if guess = "Winnepeg" then
- right:=right+1
- put "Right!"
- exit
- else
- put "Sorry wrong answer."
- end if
- tries:=tries+1
- end for
- put " Tries: ", tries
- %For command
- for times : 1 .. 3
- %Getting variable values
- put "What is the capital city of Quebec? (You only have 3 guesses) " ..
- get guess
- %if statement
- if guess = "Quebec City" then
- right:=right+1
- put "Right!"
- exit
- else
- put "Sorry wrong answer."
- end if
- tries:=tries+1
- end for
- put " Tries: ", tries
- %For command
- for times : 1 .. 3
- %Getting variable values
- put "What is the capital city of British Columbia? (You only have 3 guesses) " ..
- get guess
- %if statement
- if guess = "Victoria" then
- right:=right+1
- put "Right!"
- exit
- else
- put "Sorry wrong answer."
- end if
- tries:=tries+1
- end for
- put " Tries: ", tries
- %For command
- for times : 1 .. 3
- %Getting variable values
- put "What is the capital city of Newfoundland and Labrador? (You only have 3 guesses) " ..
- get guess
- %if statement
- if guess = "St. Johns" then
- right:=right+1
- put "Right!"
- exit
- else
- put "Sorry wrong answer."
- end if
- tries:=tries+1
- end for
- put " Tries: ", tries
- %For command
- for times : 1 .. 3
- %Getting variable values
- put "What is the capital city of PEI? (You only have 3 guesses) " ..
- get guess
- %if statement
- if guess = "Charlotte Town" then
- right:=right+1
- put "Right!"
- exit
- else
- put "Sorry wrong answer."
- end if
- tries:=tries+1
- end for
- put " Tries: ", tries
- %For command
- for times : 1 .. 3
- %Getting variable values
- put "What is the capital city of New Brunswik? (You only have 3 guesses) " ..
- get guess
- %if statement
- if guess = "Fredericton" then
- right:=right+1
- put "Right!"
- exit
- else
- put "Sorry wrong answer."
- end if
- tries:=tries+1
- end for
- put " Tries: ", tries
- put " The average of the amount of one's you got right is ",(right/10)*100,"%."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement