(Guess the Number Game) Write a program that plays “guess the number” as follows: Your program chooses the number to be guessed by selecting an int at random in the range 1–1000. The program then displays the following text in a label:

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 7PP
icon
Related questions
Question

C#

(Guess the Number Game) Write a program that plays “guess the number” as follows: Your program chooses the number to be guessed by selecting an int at random in the range 1–1000. The program then displays the following text in a label:


A TextBox should be used to input the guess. As each guess is input, the background color should change to red or blue. Red indicates that the user is getting “warmer,” blue that the user is getting “colder.” A Label should display either “Too High” or “Too Low,” to help the user zero in on the correct answer. When the user guesses the correct answer, display “Correct!” in a message box, change the Form’s background color to green and disable the TextBox. Recall that a TextBox (like other controls) can be disabled by setting the control’s Enabled property to false. Provide a Button that allows the user to play the game again. When the Button is clicked, generate a new random number, change the background to the default color and enable the TextBox.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,