Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Project 1 Algorithm

By: Minh Than


1. Start.

2. Define a constant of double data type to store the acceleration due to gravity and initialize it
with the correct value 9.8.

3. Define a constant of double data type to store the constant multiplier that converts feet to
meters and initialize it with the value 0.3048.

4. Declare the following variables:

a. Integer to store height (in feet) from which the object is dropped
b. Double to store mass (in kg) of the object
c. Double to store time (in seconds) for the object to hit the ground
d. Double to store velocity of the object (in meters per second) when it reaches the
ground

5. Prompt the user to read in the height which the object was dropped in feet.

6. Prompt the user to read in the object’s mass in kg.

7. Set up the for formula for calculating time (in seconds) taken for the object to reach the
ground, then assign it to the time variable declared earlier. Make sure to convert height value
from feet to meter using the constant multiplier initialized earlier.

8. Using the computed time above, set up a formula to calculate the velocity (in meters per
second) at which the object hits the ground.

9. Using the computed velocity above, set up a formula for calculating kinetic energy at the
moment of impact.

10. Display the result of the calculated time to the user. Ensure that the result has exactly three
digits after the decimal point

11. Display the computed velocity result to the user. Make sure that the velocity value has
exactly two digits after the decimal point.

12. Compute the kinetic energy while displaying its computed value to the user. Make sure that
the kinetic energy value has exactly four digits after the decimal point

13. End.

You might also like