Question: write three c + + functions: One function to collect and return a number between 1 and 1 0 0 , inclusive. If the user

write three c++ functions:
One function to collect and return a number between 1 and 100, inclusive. If the user enters a number that is not between 1 and 100, the program will ask the user to a new number. The function only returns a number (integer) between 1 and 100. This number will be used as time.
One function that will calculate the falling distance of an object using the following formula:
Distance =0.5*gravity*time*time;
The function returns the calculated distance as a float value.
The gravity is set as a global variable with value of 9.8.
The time is collected from the first function and passes as a parameter.
One function to prompt the result as
The falling distance is _____ meters

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!