View the step-by-step solution to:

Please help problem set Arrays You are preparing for the Boston Marathon. In order to prepare, you need to train for 10 weeks, running an increasing

Please help problem set Arrays

You are preparing for the Boston Marathon. In order to prepare, you need to train for 10 weeks, running an increasing number of miles per week, starting at running at least 2 miles your first week up to 26 miles by week 10. 

1.) Initialize the array with the appropriate number of values.

2.) What is the value in the array element when the index contains 2?

3.) What is your list length?

4.) Calculate the sum of the total miles you spent running over the 10 weeks. Calculate the average number of miles you ran.

5.) Write a search to determine whether 4 is on your list.

Top Answer

Hello! Student, I have done the implementation in python. Please... View the full answer

BostonMarathon.py

import math
#boston marathon preparation
#Lets initialize values for miles ran from week 1 to 10
miles=[2,4,7,9,12,14,18,20,23,26]
#value of element where index is 2
print("Value at index 2:...

Sign up to view the full answer

Other Answers

import java.io.*; public class BostonMarathon { public static void main(String[] args) {... View the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online