CS Lab2 Solution

$30.00 $24.00

Write a program that simulates the “Guess a number” game. First, the program defines an integer between 1 and 100 as a constant. It then asks the user to enter a guess (between 1 and 100), and reads the user’s guess. According to the guess, the program prints an appropriate message “too low – try…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:
Tags:

Description

5/5 – (2 votes)

Write a program that simulates the “Guess a number” game. First, the program defines an integer between 1 and 100 as a constant. It then asks the user to enter a guess (between 1 and 100), and reads the user’s guess. According to the guess, the program prints an appropriate message “too low – try again” or “too high – try again”, and repeats doing the above until the user guesses the correct number. At the end, the program outputs how many guesses it took the user to find the correct number.

CS Lab2 Solution
$30.00 $24.00