A student has been asked to create a simple guessing game program. This program will generate a random integer value between 1 and 100. It will then repeatedly prompt the user to input an integer value until they input the randomly generated value. The student has written a structured English description: step 1 - randomly generate an integer value between 1 and 100 inclusive step 2 - prompt the user to input an integer value step 3 - output an appropriate message if the value input was too high; then repeat from step 2 step 4 - output an appropriate message if the value input was too low; then repeat from step 2 step 5 - output an appropriate message if the value input was the same value that was randomly generated; then end the program. Write a pseudocode algorithm from this structured English description. Assume no input validation is needed.
Mark scheme
Marking points from the official mark scheme (May/June 2025). The mark or mark type is shown in brackets.
- [1] Declare all variables used
- [1] Uses RAND() function
- [1] Uses INT() function
- [1] Correct syntax for random number between 1 and 100
- [1] Conditional loop until correct number guessed
- [1] Prompt and input a guess in a loop
- [1] Check if guess is too high in a loop
- [1] Check if guess is too low in a loop
- [1] Output appropriate message (x2) when the number is not guessed correctly (in the loop) and output correct guess message
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →