A. Modify the FitnessTracker class that includes data fields for a fitness activity, the number of minutes spent participating, and the date. The class includes methods to get each field. In addition, create a default constructor that automatically sets the activity to running, the minutes to 0, and the date to January 1 of the current year. Create an application that demonstrates each method works correctly.
b. Create an additional overloaded constructor for the FitnessTracker class you created in Exercise 3a. This constructor receives parameters for each of the data fields and assigns them appropriately. Add any needed statements to the TestFitnessTracker.java application to ensure that the overloaded constructor works correctly, save it, and then test it.
An example of what it should look like:
running 0 minutes on 2021-01-01
bicycling 35 minutes on 2020-08-20
What's done:
import java.time.*;
public class FitnessTracker {
String activity;
int minutes;
LocalDate date;
// constructor for 3a
public FitnessTracker() {
}
// constructor for 3b
public FitnessTracker(String a, int m, LocalDate d) {
}
public String getActivity() {
}
public int getMinutes() {
}
public LocalDate getDate() {
}
}