Question: *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 x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
