|
-
Mar 18th, 2007, 02:05 PM
#1
Thread Starter
Member
School programming help
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.
-
Mar 18th, 2007, 03:52 PM
#2
Re: School programming help
Please show us what you have done so far, and let us know where you are having trouble. We will help you, but we won't do it for you.
-
Mar 18th, 2007, 06:28 PM
#3
Re: School programming help
Write on what you think the logical process for doing this should be either on a piece of paper or using Notepad or other text editor. Then use this as a guide to write your code. Then if you have trouble either getting started or with a particular part of the logic or presentation, you can ask a specific question about it.
-
Mar 19th, 2007, 11:03 AM
#4
Thread Starter
Member
Re: School programming help
Thanks very much. I'll do that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|