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 theclass diagrams. Methods and constructors are explained below. You will define 4

*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 RunTest.testToString [JUnit] /Library/Java/JavaVirtu Activity - Run RUN: Gym Running Notes: A short running on the treadmill Calories: 300 Distance: 3.0 miles Minutes: 30 min

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!