Question: Create all classes in 1 single file/Java class Make use of import java.util.Scanner; import java.io.IOException; import java.io.File; enum Month { Jan, Feb, Mar, Apr, May,

 Create all classes in 1 single file/Java class Make use ofimport java.util.Scanner; import java.io.IOException; import java.io.File; enum Month { Jan, Feb, Mar,Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec} Objective Classes and

Create all classes in 1 single file/Java class

Make use of

import java.util.Scanner; import java.io.IOException; import java.io.File;

enum Month { Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec}

Objective Classes and Objects Composition classes Strings Enumeration data types Text Files Task (5 marks) While exercising, you can use a heart rate monitor to see that your heart rate stays within range suggested by the trainers and doctors. The formula to calculate your maximum heart rate per minute is 220 (magic number) minus your age in years. Your target heart rate is a range that's 50 to 85% of your maximum heart rate. Let us explore the following UML diagram: cenumeration> Month A Jan A Feb A Mar A Apr A May Jun HeartRates Test + static void main(String args) A Aug Asep A Oct Nov A Dec HeartRates 71.1 month -String firstName - String lastName - Date dob - int currentYear Date - int day - Month month - int year +Date > Date(int day, Month month, int year) Date(Date d) +int getDayo + Month getMonth +int getYearo +void setDate(int day, Month month, int year) +HeartRates (String firstName, String lastName, Date dob, int currentYear) +HeartRates (HeartRates hr) String getFirstName +void setFirstName(String firstName) String getLastName +void setLastName(String lastName) +Date getDOBO +void setDOB(Date dob) +int getCurrentYearo o+void setCurrentYear(int currentYear) +int getage +int getraximum HeartRate double getMinimumTargetHeartRate double getMaximumTargetHeartRate() +void printinfoo Design 4 classes An enumeration Month class A Date class. Note that, other than the usual information for a calendar date (day, month, and year), you have constructors, accessor and mutator methods. For the default constructor, initialize the date to 1st January 2021. A HeartRate class has the same features as the Date class (constructors, accessor and mutator methods). You include also a few important methods related to the class; for example, get the maximum heart rate method, get the minimum and the maximum of the targeted heart rate; and a method to print out an object of this class. You construct a text file (using text editor, for example notepad) to store two persons' profiles. The sample format of this text file is: Ah Beng Tan 15 Oct 1988 2018 Robert Richard Wong 31 Dec 2005 2018 In the main method (defined in another class), try to read the information from the above text file and display the following output: Name: Ah Beng, Tan Date of birth: 15 Oct 1988 Current year: 2018 Your age: 30 years old Clinic analysis, base on your age : 1. Your maximum heart rate is 190 2. Your minimum target heart rate is 95.00 3. Your maximum target heart rate is 161.50 Name: Robert Richard, Wong Date of birth: 31 Dec 2005 Current year: 2018 Your age: 13 years old Clinic analysis, base on your age: 1. Your maximum heart rate is 207 2. Your minimum target heart rate is 103.50 3. Your maximum target heart rate is 175.95

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!