Difference:
CSC121F2024Lab10Hint2
( vs. 1)
Revision 1
2024-06-14 -
CathyBareiss
Line: 1 to 1
Added:
>
>
META TOPICPARENT
name="CSC121F2024Lab10"
Hint 2: Quiz with arrays: Repeating wrong answers
Create a boolean array (the size of the number of questions) and initialize all to false.
When a question is answered correctly, set that element in the boolean array to true.
To find a question that has not been answered correctly:
generate a random integer in the range of questions
while that question has been answered correctly
generate another random integer in the same range
return the random number that allowed the loop to exit
View topic
|
H
istory
:
r1
|
More topic actions...
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback