2009 Old Spec
From AQA Computer Science
This question is far too simple and this was the first ever exam which required you to program live.
The variable table, Table 2, and the Structured English algorithm describes a simplified version of the Guess the Word/Phrase Game.
|NewWord||String||Stores the setter’s word to be guessed|
|UserWordGuess||String||Stores a word that is the user’s guess|
OUTPUT "The new word?"
OUTPUT "Your guess?"
IF UserWordGuess IS EQUAL TO NewWord
THEN OUTPUT "CORRECT"
ELSE OUTPUT "INCORRECT"
What you need to do
- Write a program for the above algorithm in the programming language of your choice.
- Test the program as follows:
- Test 1: Input of the new word EAGLE followed by a correct guess.
- Test 2: Input of the new word BEAR followed by an incorrect guess.