Question
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:
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/hourStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started