Question: Define a lass with the following specifications: Create a class called MarathonRunner that has three private data members: name (String), distance (double) and time (double)

Define a lass with the following specifications:

  1. Create a class called MarathonRunner that has three private data members: name (String), distance (double) and time (double)

Define a lass with the following specifications: Create a class called MarathonRunner

ne a class with the following specifications: 20 Points Create a class called Marnthon Runner that has three private data members anme (Sting) distance (doubles and lime (double) Write a consinicior that accepts name, distance, and time as input parameters to initialive the prvake data inembers. Provide only one accessor (get) method and one mulator (set) method for the distance dara member d. Define a private method called calculateSpecdo which calculatos and retung the speed double of the marathon uriner. The speed is calculated using the formula specd= dista ma Define a public method called isFaster() that accepts as input parameter a speed reenca double). The method should return true if the current imner s speed is faster than the speed record, otherwise, reme. faise. Define a public method called displayDetails to display on the sercen the unner details as in the following sample: Runner name: Ahmed Distance traveled: 11700 m Time elapsed: 2372.0 5 Runner's Speed: 4193 m/s Use the editor xoxo W

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!