a. Create a Fitness Tracker class that includes three data fields for a fitness activity: a String

Question:

a. Create a Fitness Tracker class that includes three data fields for a fitness activity: a String for the name of the activity, an int for the number of minutes spent participating, and a Local Date for the date. The class includes methods to get each field. 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. Overload the constructor that receives parameters for each of the fields and assigns them appropriately. Save the file as FitnessTracker.java.
b. Create an application that instantiates two Fitness Tracker objects. Prompt the user for values for one object, and pass those values to the three constructor parameters. Retain the default constructor values for the other object. Display the values for each object. Save the program as TestFitnessTracker.java.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Programming

ISBN: 9780357673423

10th Edition

Authors: Joyce Farrell

Question Posted: