Suppose Dave drops a watermelon off a high bridge and lets it fall until it hits the water. If we neglect air resistance, then the distance d in meters fallen by the watermelon after t seconds is d = 0.5 * g * t2, where the acceleration of gravity g = 9.8 meters/second2. Write a program that asks the user to input the number of seconds that the watermelon falls and the height h of the bridge above the water. The program should then calculate the distance fallen for each second from t = 0 until the value of t input by the user. If the total distance fallen is greater than the height of the bridge, then the program should tell the user that the distance fallen is not valid. Sample Run 1: Please input the time of fall in seconds Please input the height of the bridge in meters : 2 100

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a c++ program using looping.

Suppose Dave drops a watermelon off a high bridge and lets it fall until it hits the
water. If we neglect air resistance, then the distance d in meters fallen by the watermelon
after t seconds is d = 0.5 * g * 12, where the acceleration of gravity g = 9.8 meters/second2.
Write a program that asks the user to input the number of seconds that the watermelon falls
and the height h of the bridge above the water. The program should then calculate the
distance fallen for each second from t = 0 until the value of t input by the user. If the total
distance fallen is greater than the height of the bridge, then the program should tell the user
that the distance fallen is not valid. Sample Run 1:
Please input the time of fall in seconds
Please input the height of the bridge in meters :
2
100
Transcribed Image Text:Suppose Dave drops a watermelon off a high bridge and lets it fall until it hits the water. If we neglect air resistance, then the distance d in meters fallen by the watermelon after t seconds is d = 0.5 * g * 12, where the acceleration of gravity g = 9.8 meters/second2. Write a program that asks the user to input the number of seconds that the watermelon falls and the height h of the bridge above the water. The program should then calculate the distance fallen for each second from t = 0 until the value of t input by the user. If the total distance fallen is greater than the height of the bridge, then the program should tell the user that the distance fallen is not valid. Sample Run 1: Please input the time of fall in seconds Please input the height of the bridge in meters : 2 100
Time Falling (seconds)
文大 大 大 大 大**
Distance Fallen (meters)
1
4.9
2
19.6
Sample Run 2:
Please input the time of fall in seconds
Please input the height of the bridge in meters :
4
50
Time Falling (seconds)
Distance Fallen (meters)
*********
t 大
1
4.9
2
19.6
3
44.1
4
78.4
.Warning-Bad Data.. .
The distance fallen exceeds the height of the bridge.
ER
Transcribed Image Text:Time Falling (seconds) 文大 大 大 大 大** Distance Fallen (meters) 1 4.9 2 19.6 Sample Run 2: Please input the time of fall in seconds Please input the height of the bridge in meters : 4 50 Time Falling (seconds) Distance Fallen (meters) ********* t 大 1 4.9 2 19.6 3 44.1 4 78.4 .Warning-Bad Data.. . The distance fallen exceeds the height of the bridge. ER
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY