Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reads in the distance Nyad swam and the time it took her to cover that distance for each year listed in

Write a program that reads in the distance Nyad swam and the time it took her to cover that distance for each year listed in the table. The program will read in the information sequentially. The program should then compute the speed for each year. The program should also compute the average speed. An example of the programs execution sequence is shown below. The output should be displayed in a tabular format as shown below the input prompts. image text in transcribed

Diana Nyad is a long-distance swimmer with five major career accomplishments in the sport. Watch Nyad's TED talk Never_ever give up if you want to learn more about her 2013 feat. Her results are summarized in the following table Year Distance (miles Time (hours 1974 22 miles 1975 28 mile:s 1978 76 miles 1979 102 miles 2013 110 miles 8 hours 8 hours 42 hour:s 27 hours 53 hours Write a program that reads in the distance Nyad swam and the time it took her to cover that distance for each year listed in the table. The program will read in the information sequentially. The program should then compute the speed for each year. The program should also compute the average speed. An example of the program s execution sequence is shown below. The output should be displayed in a tabular format as shown below the input prompts. Enter the distance Diana Nyad swam in 1974: How many hours did it take Nyad to swim the distance? Enter the distance Nyad swam in 1975: How many hours did it take Nyad to swim the distance? Enter the distance Nyad swam in 1978: 7 6 How many hours did it take Nyad to swim the distance? 42 Enter the distance Nyad swam in 1979: 102 How many hours did it take Nyad to swim the distance? 27 Enter the distance Nyad swam in 2013: 110 How many hours did it take Nyad to swim the distance? 53 I Year Distance (miles) I Time (hour I Speed (miles/hour 19741 22 miles 1975 28 miles 1978 76 miles 1979 102 miles 2013 110 miles I 8 hours I 8 hours I 42 hours I 27 hours I 53 hours I 2.75 1 3.5 1 1.8095238095238095 I 2.0754716981132075 Diana Nyad's average speed is 2.7825546570829593 miles/hour

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions