Question: (C++) For this, I need to have a (main.cpp) a (.h) and a (.cpp). Please help!! This project will continue to familiarize the student with
This project will continue to familiarize the student with functions. Re-write Project 6 so that distance and velocity are calculated with two functions that take acceleration due to gravity, a, and time, t, as parameters. Once again, the program will print out t, x, and v for each time point in tabular form. The program should prompt for total time (in seconds), and step-size (in seconds) for the calculations, and print out the table of results. An example run: Enter the time, in seconds: 0.1 Enter the step-size, in seconds: 0.01 t: 0.0000 sec t: 0.0100 sec t: 0.0200 sec t: 0.0300 sec t: 0.0400 sec t: 0.0500 sec t: 0.0600 sec t: 0.0700 sec t: 0.0800 sec t: 0.0900 sec t: 0.1000 sec x: 0.0000 m x: 0.0005 m x: 0.0020 m x: 0.0044 m x: 0.0078 m x: 0.0123 m x: 0.0177 m x: 0.0240m x: 0.0314 m x: 0.0397 m x: 0.0490 m v: 0.0000 m/s v: 0.0981 m/s v: 0.1961 m/s v: 0.2942 m/s v: 0.3922 m/s v: 0.4903 m/s v: 0.5884 m/s v: 0.6864 m/s v: 0.7845 m/s v: 0.8825 m/s v: 0.9806 m/s The needed equations and constant are: v=at ; x=-at2 ; a= accel, due to gravity= 9.806 m/sec2 round off the output to four decimal places (using setprecision (4))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
