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 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 object's falling distance. Modularity: Your program should contain 2 functions: main - will call the falling distance function in a loop, passing it the values 1-10 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

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter1: Fundamentals Of C++ Programming
Section1.3: Preliminary Three: Software Development
Problem 7E: (Statistics) This is the formula for the standard normal deviate, z, used in statistical...
icon
Related questions
Question
100%

Please follow the instructions in addition to these

  • 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.
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 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 object's falling distance.
Modularity: Your program should contain 2 functions:
main - will call the falling_distance function in a loop, passing it the values 1-10 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
Transcribed Image Text: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 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 object's falling distance. Modularity: Your program should contain 2 functions: main - will call the falling_distance function in a loop, passing it the values 1-10 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
1
2
3
4
5
6
7
8
9
10
4.90
19.60
44.10
78.40
122.50
176.40
240.10
313.60
396.90
490.00
Transcribed Image Text:Output: Should look like this: Time Falling Distance 1 2 3 4 5 6 7 8 9 10 4.90 19.60 44.10 78.40 122.50 176.40 240.10 313.60 396.90 490.00
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

There should be two files or codes for this solution: the distance code and the second code fallingdistance

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning