Weather balloons are used to gather temperature and pressure data at various altitudes in the atmosphere. The balloon rises because the density of the helium in the balloon is less than the density of the surrounding air outside the balloon. As the balloon rises, the surrounding air becomes less dense, and thus the balloon's ascent slows until it reaches a point of equilibrium. During the day, sunlight warms the helium trapped inside the balloon, which causes the helium to expand and become less dense and the balloon to rise higher. During the night, however, the helium in the balloon cools and becomes denser, causing the balloon to descend to a lower altitude. Over time, this process generates a set of altitude measurements that can be approximated with a polynomial equation.
Equation for altitude (meters)
Altitude = -0.12t4 + 12t3 - 380t2 + 4100t + 220
________________________________________________
Equation for velocity (meters/hour)
Velocity = -0.48t3 + 36t2 - 760t + 4100
Print a table of the altitude and velocity for this weather balloon using units of meters and meters per second. Let the user enter the start time, increment in time between lines of the table, and ending, time.The range of time cannot exceed 48 hours (hrs must be validated). In addition to printing the table, print the peak altitude and its corresponding time.
Sample Output:
Enter initial value for table (hrs)0
Enter increment between lines (hrs)1
Enter final value for table (hrs)5
Weather Balloon Information
Time Height Velocity
0.00 220.00 1.14
1.00 3951.88 0.94
2.00 6994.08 0.76
3.00 9414.28 0.59
4.00 11277.28 0.45
5.00 12645.00 0.32
Maximum balloon height was 12645.00 meters and it occurred at 5.00 hours