Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++ PLEASE (8) Write a program that generates a random number between 1 and 100 and asks the user to guess what the number

IN C++ PLEASE image text in transcribed

(8) Write a program that generates a random number between 1 and 100 and asks the user to guess what the number is. Make sure the user knows the range that is used to produce the random number. If the user's guess is higher than the random number, the program should display To high, try again. If the user's guess is lower than the random number, the program should display To low, try again. The program should use a loop that repeats until the user correctly guesses the number. When the user's guess is correct, display a message telling them so and how many tries it took. This program will be graded by hand. (9) For this program, you will need a data file Random.txt that contains a long list of numbers. You will need to download this file and place it in the same folder that you save your program to. Then write a program that opens the file, reads all the number from the file, and calculates the following: a. The number of numbers in the file b. The sum of all the numbers in the file (a running total) c. The average of all the numbers in the file The program should display the number of numbers, found in the file, the sum of the numbers, and the average of the numbers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions