umber to be gues
Using CPPWinFormsApp and C++ in VisualStudio 2022
-------------------------------------------------------------------------------------------------------
Write a program that plays "guess the number" game as follows:
Your program chooses the number to be guessed by selecting an integer at random in the range 1-10. The program then dispalys the following text in the label:
I have a number between 1 and 10- can you guess my number?
Please enter your first guess
A textbox should be used to input the guess. As each guess is input, the background color of the label should change to either red or blue.
Red indicates that the user is getting "warmer", and the blue indicates that the user is getting "colder". A label should display either "Too high" or "Too low".
When the user obtains the correct number"Correct" should be displayed. The background should become green and the textbox used for input should become uneditable.
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 reset the input textbox to editable.
Step by step
Solved in 2 steps with 3 images