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 B 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 gt
The variables in the formula are as follows:
d is the distance in meters
g is 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 functions:
main will call the fallingdistance function in a loop, passing it the values as arguments seconds the object has been falling It will display the returned distance.
fallingdistance 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. fallingdistance 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
Programming Style Requirements.
Comments Begin your program with a comment that includes: a your name, bprogram status either Complete or describe any incomplete or nonfunctioning part of your program cA 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 totaltaxes or numcookies.
Function names use meaningful verb names for functions such as displaytaxes.
Named constants Use named constants for all number values that will not be changed in the program such as RECIPESUGAR See section on Named Constants
Your program file: yourlastnameLabBpy
Your distance module: distance.py
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
