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 可以看到全部内容