Answered step by step
Verified Expert Solution
Question
1 Approved Answer
*CODE IN JAVA* Implement the following classes as represented in the class diagrams. Methods and constructors are explained below. You will define 4 types of
*CODE IN JAVA*
Implement the following classes as represented in the class diagrams. Methods and constructors are explained below. You will define 4 types of activities: Run, Bike, Swim and the fourth activity is of your choice. Note that the getter/setter methods for all properties are not included in the UML diagram. Run -title: String - notes: String - caloriesBurned: int - minutes: int - distance: double + Run(title: String, notes: String, caloriesBurned: int, minutes: int, distance: double) Bike -title: String - notes: String - caloriesBurned: int - minutes: int - distance: double - location: String + Bike(title: String, notes: String, caloriesBurned int, minutes: int, distance: double, location: String) Swim -title: String - notes: String - caloriesBurned: int - distance: double - laps: int - stroke: String + Swim(title: String, notes: String, caloriesBurned: int, distance: double, laps: int, stroke: String) Override each of the toString() methods to format and output each type of activity. You should print out each property of the object. Suppose that you have a running activity in the gym. You may create an instance of Run class and print out the running activity details in the terminal window. Here is one possible sample output from the toString() method of the Run class. Please note that the output format of your to String() method may not be the same as the sample, but you should print out each property of the object. R Problems @ Javadoc Declaration Console xStep 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