Create an application called GuessingGame which simulates a simple number game where the computer picks a random number between 1 and 100 (inclusive) and the user must guess the number. The application will print the words HIGHER, LOWER or CORRECT after each guess. Here is an example run of the application (red indicates example user input):
Pick a number between 1 and 100.
The user will start off with 100 points. Each time a wrong guess is made, 1 point is subtracted from the point total.
程式執行時,在DOS視窗中:
Your guess: 5
HIGHER
Your guess: 57
HIGHER
Your guess: 99
LOWER
Your guess: 80
LOWER
..
訪客只能看到部份內容,免費 加入會員 或由臉書 Google 可以看到全部內容