const a := 12
const b := 5
const c := 37
const d := 11
var answer, response, count : int
count := 0
put "What is the value of ", a, " mod ", b, "?"
get response
answer := a mod b
if response = answer then
put "You are correct"
count := count + 1
else
put "Sorry, the correct answer is ", answer
put "Perhaps you should review chapter two"
end if
put "What is the value of ", c, " mod ", d, "?"
get response
answer := c mod d
if response = answer then
put "You are correct"
count := count + 1
else
put "Sorry, the correct answer is ", answer
put "Perhaps you should review chapter two!"
end if
put "You answered correctly ", count, " time" ..
if count not = 1 then
put "s" ..
end if
put " out of 2 attempts."
|