Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

Write a python program from the question that lets the user enters the:
• initial height from which the ball is dropped
• the bounciness index
• the number of times the ball is allowed to continue bouncing
• Output should be the total distance travelled by the ball.

 

The program should work and display correct outputs. Example is included below the question

A standard science experiment is to drop a ball d see how high it bounces.
Once the "bounciness" of the ball has been determined, the ratio gives a bounciness index.
For example, if a ball dropped from a height of 10 feet bounces 6 feet high, the index is 0.6, and the total distance travelled by the ball is 16
feet after one bounce. If the ball were to continue bouncing, the distance after two bounces would be 10 ft + 6 ft +6 ft +3.6 ft = 25.6 ft.
Note that the distance travelled for each successive bounce is the distance to the floor plus 0.6 of that distance as the ball comes back up.
Write a program that lets the user enters the:
initial height from which the ball is dropped
the bounciness index
the number of times the ball is allowed to continue bouncing
Output should be the total distance travelled by the ball.
Below is an example of the program input and output:
Enter the height from which the ball is dropped: 25
Enter the height from which the ball is dropped: 25
Enter the bounciness index of the ball: .5
Enter the number of times the ball is allowed to continue bouncing: 3
Enter the bounciness index of the ball: .5
Enter the number of times the ball is allowed to continue bouncing: 3
Total distance traveled is: 65.625 units.
Total distance travelled is: 65.625 units.
expand button
Transcribed Image Text:A standard science experiment is to drop a ball d see how high it bounces. Once the "bounciness" of the ball has been determined, the ratio gives a bounciness index. For example, if a ball dropped from a height of 10 feet bounces 6 feet high, the index is 0.6, and the total distance travelled by the ball is 16 feet after one bounce. If the ball were to continue bouncing, the distance after two bounces would be 10 ft + 6 ft +6 ft +3.6 ft = 25.6 ft. Note that the distance travelled for each successive bounce is the distance to the floor plus 0.6 of that distance as the ball comes back up. Write a program that lets the user enters the: initial height from which the ball is dropped the bounciness index the number of times the ball is allowed to continue bouncing Output should be the total distance travelled by the ball. Below is an example of the program input and output: Enter the height from which the ball is dropped: 25 Enter the height from which the ball is dropped: 25 Enter the bounciness index of the ball: .5 Enter the number of times the ball is allowed to continue bouncing: 3 Enter the bounciness index of the ball: .5 Enter the number of times the ball is allowed to continue bouncing: 3 Total distance traveled is: 65.625 units. Total distance travelled is: 65.625 units.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education