To determine the falling distance (dist) of an object to the ground due to the gravity (g), the following formula is used, dist = 0.5* g * time? Where the variables: dist: the distance in meters to be calculated g: is set to 8.9 time: time in seconds that the object has been falling Write a program to determine distance of the falling object. The program should contain a two functions calcDist() and getTime() beside the main function. The variable time is defined as a global variable while g is a constant global variable. The function calcDist() calls the function get Time() that prompts the user to enter a value for time. The function calcDist() then should calculate and display the value of dist. From the main function, main(), calls the function calcDist(). Write your program based on the following output Sample: Enter the value of time: 4 [ENTER] The distance is that the object travelled is: 78.4 meters Guide to your coding design: define the two global variables and the two functions prototypes. - create the function getTime() to read value of time from the user - create the function calcDist(() and call getTime() inside it. - calculate dist inside calcDist() using the above formula and display its value. - call the function calcDist() from the main function main().

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter1: Fundamentals Of C++ Programming
Section: Chapter Questions
Problem 5PP
icon
Related questions
Topic Video
Question

C++

To determine the falling distance (dist) of an object to the ground due to the gravity (g), the
following formula is used,
dist = 0.5* g * time?
Where the variables:
dist: the distance in meters to be calculated
g: is set to 8.9
time: time in seconds that the object has been falling
Write a program to determine distance of the falling object. The program should contain a two
functions calcDist() and getTime() beside the main function. The variable time is defined
as a global variable while g is a constant global variable. The function calcDist() calls the
function get Time() that prompts the user to enter a value for time. The function calcDist()
then should calculate and display the value of dist. From the main function, main(), calls the
function calcDist().
Write your program based on the following output Sample:
Enter the value of time: 4 [ENTER]
The distance is that the object travelled is: 78.4 meters
Guide to your coding design:
define the two global variables and the two functions prototypes.
- create the function getTime() to read value of time from the user
- create the function calcDist(() and call getTime() inside it.
- calculate dist inside calcDist() using the above formula and display its value.
- call the function calcDist() from the main function main().
Transcribed Image Text:To determine the falling distance (dist) of an object to the ground due to the gravity (g), the following formula is used, dist = 0.5* g * time? Where the variables: dist: the distance in meters to be calculated g: is set to 8.9 time: time in seconds that the object has been falling Write a program to determine distance of the falling object. The program should contain a two functions calcDist() and getTime() beside the main function. The variable time is defined as a global variable while g is a constant global variable. The function calcDist() calls the function get Time() that prompts the user to enter a value for time. The function calcDist() then should calculate and display the value of dist. From the main function, main(), calls the function calcDist(). Write your program based on the following output Sample: Enter the value of time: 4 [ENTER] The distance is that the object travelled is: 78.4 meters Guide to your coding design: define the two global variables and the two functions prototypes. - create the function getTime() to read value of time from the user - create the function calcDist(() and call getTime() inside it. - calculate dist inside calcDist() using the above formula and display its value. - call the function calcDist() from the main function main().
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Instruction Format
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT