Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java. Thank you in advance! Problem: A group of friends decide to run the Boston Marathon. Their names and times (in minutes) are below: Name

Java. Thank you in advance!

image text in transcribed

Problem: A group of friends decide to run the Boston Marathon. Their names and times (in minutes) are below: Name Elena Thomas Hamilton Time (minutes) 341 273 278 Suzie 329 Phil Matt Alex Emma John James Jane Emily Daniel Neda Aaron Kate 445 402 388 275 243 334 412 393 299 343 317 265 Find the fastest runner. Print the name and his/her time (in minutes). Optional: Find the second fastest runner. Print the name and his/her time in minutes). Write a method that takes as input an array of integers and returns the index corresponding to the person with the lowest time. Run this method on the array of times. Print out the 2 name and time corresponding to the returned index. Write a second method to find the second-best runner. The second method should use the first method to determine the best runner, and then loop through all values to find the second-best (second lowest) time. Here is a program skeleton to get started: class Marathon public static void main(String[] arguments) { String[] names= { "Elena", "Thomas", "Hamilton", "Suzie", "Phil", "Matt", "Alex", "Emma", "John", "James", "Jane", "Emily", "Daniel", "Neda", "Aaron", "Kate" }; int[] times = { 341, 273, 278, 329,445, 402,388, 275, 243, 334,412, 393, 299, 343, 317, 265 }; for (int i = 0; i

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_2

Step: 3

blur-text-image_3

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 Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago