Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# program Write a program that will continue to prompt the user to guess a number until the correct number has been entered. You should

image text in transcribed

C# program

Write a program that will continue to prompt the user to guess a number until the correct number has been entered. You should also consider user validation; that is, has the user entered a number less than 1 or greater than 10? Have they entered a character? Start by creating a new project and name its main class and file) as GuessingNumber. Then proceed with the following steps: - Create an integer variable called number and set it equal to 5. - Prompt the user to guess a number between 1 and 10. - If the user enters number 5, print You have guessed the number! Well done!" - If they do not enter 5, continue to prompt the user to enter a number until they enter 5. Compile, run and check the program for potential errors. Now, alter the program so that it takes a number entered by a user (say, user 1). This number is set as the number to be guessed by the second user. Then ask user 2 to input their own number. Check to see if the number that user 2 entered is equal to the number user 1 entered. Continue this process until the user 2 guesses the correct number. Remember that for this program you should validate the user's input. Finally, run and check the program again

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions