Question: program Create a class called Marathon Runner that has three private data members: name (String), distan (double) and time (double). b. Write a constructor that

program
Create a class called Marathon Runner that has three private data members: name (String), distan (double) and time (double). b. Write a constructor that accepts name, distance, and time as input parameters to initialize the privat data members. Provide only one accessor (get) method and one mutator (set) method for the distance data membe d. Define a private method called calculateSpeed0 which calculates and returns the speed (double) distance marathon runner. The speed is calculated using the formula: speed = time Define a public method called isFaster that accepts as input parameter a speed record(double method should return true if the current runner's speed is faster than the speed record, otherwise false. Define a public method called displayDetails to display on the screen the runner's details a following sample: Runner name: Ahmed Distance traveled: 11700 m Time elapsed: 2372.0 s Runner's Speed: 4.93 m/s
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
