1 create a java class called day the class should include


Part 1: Object-Oriented Programming:

Class Day

1. Create a Java class called Day. The class should include three private fields for the year, month, and day.

2. Add setters and getters for the three private fields

3. Add a constructor that takes 3 arguments for: year, month, and day.

4. Add a public method called printDate(), which prints the date in the following format "MM/DD/YYY". Forexample, "02/18/2016"

Class DailyWeather

5. Create a second java class called DailyWeather. This class should extend Day.

6. Define a constructor that also takes 3 arguments: year, month, and day. Use the super(...) method to set thesevalues.

7. Add the following variables for the class DailyWeather:• maxTemp• minTemp• meanTemp• meanHumidity• maxWind• meanWind

8. Add setters and getters for all the variables above.

Part 2: File IO

1. Download the file "weather2015.txt". This file is a comma-delimited table that includes daily weatherinformation for the year 2015. The first line specifies the meaning of each column:

2. In a new Java class with a main method, create an ArrayList of type DailyWeather.

3. Read the file one line at a time, and for each day in the file, create a DailyWeather object with the valuesspecified in the file. When you are done reading the file, you should have 365 objects in your ArrayList.

4. Using a for loop, find which dailyWeather object has the highest meanTemp value. Print the datecorresponding to the hottest day in 2015. If there is more than one object with the same highest meanTempvalue, only print the first one.

5. Find and print the date corresponding to the most humid day in 2015

6. Find and print the date corresponding to the maximum wind speed (maxWind). What was the meantemperature in that day?

Solution Preview :

Prepared by a verified Expert
Business Management: 1 create a java class called day the class should include
Reference No:- TGS01732822

Now Priced at $30 (50% Discount)

Recommended (90%)

Rated (4.3/5)