Solution: Random Number

Let's discuss the solution to the exercise on random numbers.

We'll cover the following

Problem

This exercise uses a random number for a guessing game. Create a console application called Guessing Game that meets the four requirements below.

  1. Display the following: Guess the computer’s number between 1 and 10. You have 3 attempts!.
  2. Have the computer select a random number from 1-10.
  3. Have the ability to guess the computer’s number three times.
  4. Display a message saying if the guess was low, high, or correct.

Solution

Have a look at the solution’s code.

Get hands-on with 1200+ tech skills courses.