Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
-
Create a class called MarathonRunner that has three private data members: name (String), distance (double) and time (double)
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
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