Question: create a C + + program that will check how far a random number is from a given number. The program should have the following

create a C++ program that will check how far a random number is from a given number. The program should have the following functions:
A function that will ask the user to enter a value between -5 and 5. If the user enters another number that is not between -5 and 5, inclusive, the program will ask the user to enter another number again. The function returns only a number between -5 and 5.
A function that randomly generates and returns a number between -5 and 5.
A function that finds and returns the difference between the number entered by the user and the random number.
A function that prompts the result as:
Random number ____ is ____ steps apart from number _____

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!