Question: Lab 5 B Value Returning Functions Falling Distance When an object is falling because of gravity, the following formula can be used to determine the

Lab 5B Value Returning Functions
Falling Distance
When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period:
d =(1)/(2) gt2
The variables in the formula are as follows:
d is the distance in meters
g is 9.8(the gravitational constant)
t is the amount of time in seconds the object has been falling
Your program will calculate the distance in meters based on the objects falling distance.
Modularity: Your program should contain 2 functions:
main will call the falling_distance function in a loop, passing it the values 110 as arguments (seconds the object has been falling). It will display the returned distance.
falling_distance will be passed one parameter which is the time in seconds the object has been falling and will calculate and return the distance in meters. falling_distance should be stored in a separate file (module) called distance.py You will import distance before your main function in your original program file.
Input Validation: None needed
Output: Should look like this:
Time Falling Distance
-----------------------------
14.90
219.60
344.10
478.40
5122.50
6176.40
7240.10
8313.60
9396.90
10490.00
Programming Style Requirements.
Comments Begin your program with a comment that includes: a) your name, b)program status either Complete or describe any incomplete or non-functioning part of your program c)A 1-3 line description of what the program does.
Function comments each function should begin with a comment explaining what the function does
Variable names use meaningful variable names such as total_taxes or num_cookies.
Function names use meaningful verb names for functions such as display_taxes.
Named constants Use named constants for all number values that will not be changed in the program such as RECIPE_SUGAR =1.5. See section 2.9 on Named Constants
Your program file: yourlastname_Lab5B.py
Your distance module: distance.py

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 Programming Questions!