For this assignment, write a program that will analyze the data from a physics e
ID: 3623234 • Letter: F
Question
For this assignment, write a program that will analyze the data from a physics experiment.The data consists of a series of position measurements for a moving object. The position measurements will be entered by the user of the program as they are continually prompted. Each of the position measurements that the user enters will have been recorded at uniform time intervals. This time interval will be entered by the user when the program begins and will be followed by the series of position measurements. Each position should be greater than or equal to the previous position because the object is either moving in one direction or still, but never moving backwards. Therefore a negative position measurement will be used to signal the end of the user's data for the run of the program.
After each of the position measurements has been entered, calculate and display the following:
the average velocity for the time interval
the average acceleration for the time interval
Calculations
Use the following formulas for the calculations:
change of position = current position - previous position
change of velocity = current velocity - previous velocity
average velocity = change of position / time interval
average acceleration = change of velocity / time interval
Notes
The starting position and starting velocity should both be 0.
There should be a loop to validate the position entered by the user. As stated earlier, each position that the user enters must be greater than or equal to the previous position. Each time the user enters an invalid position, an error message that includes the invalid position as well as the previous valid position should be displayed and the user should be given a chance to enter the current position again.