Hi
I am in Britain doing Standard Grade Physics. I have been given a Credit assesmant but I am stuck on it.
Here is the task and an example from the sheet
A program is required to prompt the user to guess a randomly-chosen whole
number between 1 and 20. The input should be validated. If the guess is incorrect, the user should be told if the target number is bigger or smaller.
This process should continue until the target number is guessed correctly. The user should then be told how many valid guesses were made.
An example of output is shown below. The output from your program may look different but must meet the specification.
I am thinking of a whole number between 1 and 20.
What Is the number? 83
Enter a whole number between 1 and 20, please. 0
Enter a whole number between 1 and 20, please. 4.9
Enter a whole number between 1 and 20, please 11
My number is smaller than your guess.
What is the number? 3
My number is bigger than your guess.
What is the number? 8
My number is smaller than your guess.
What is the number? 5
My number is bigger than your guess.
is the number? 7
Correct. I was thinking of 7.
The number of valid guesses was 5.
Please help as I don't have much more time to complete this. Thanks.
