Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Write a program called LongDistanceSwim that reads in the distance Nyad swam and the time it took her to cover that distance for each year listed in the tablefrom spreadsheet. The program will read the information sequentially store the values(distance and time)in variables. 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 sample output. The output should look like this:

image text in transcribed

Enter the distance Diana Nyad swam in 1974: 22 How many hours did it take Nyad to swim the distance? 8 Enter the distance Nyad swam in 1975: 28 How many hours did it take Nyad to swim the distance? 8 Enter the distance Nyad swam in 1978: 76 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 +- | Year | Distance (miles) | Time (hour) | Speed (miles/hour) | 1974 | 1975 | 1978 | 1979 | 2013 | 22 miles | 28 miles | 76 miles | 102 miles | 110 miles | 8 hours 18 hours | 42 hours | 27 hours | 53 hours | 2.75 | 3.5 | 1.8095238095238095 | 3.7777777777777777 | 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

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions