Computer Science Canada Help with quiz |
Author: | doey55 [ Wed Apr 28, 2004 9:05 pm ] | ||
Post subject: | Help with quiz | ||
Hi I just need to know how to keep score without doing the if statement every time to do " 1 out of 3 " etc thanx
|
Author: | Dan [ Wed Apr 28, 2004 9:09 pm ] |
Post subject: | |
there is alot easer way of doing this, if u just store each question in an array and the right awaer in another one then u could ask all the questions in a loop with one if stament and one get and one put. any how since u are all ready checking if the awaser is right after the question why not just make a var like score with is an int and and 1 to it each time they get a question right and you print out corcect? then at the end just output "you got ", score, " out of 3" |
Author: | doey55 [ Wed Apr 28, 2004 9:10 pm ] |
Post subject: | |
could you give me an example plz |
Author: | Dan [ Thu Apr 29, 2004 1:52 pm ] | ||
Post subject: | |||
this is an example of adding a var to count the right questions.
|