Object-oriented programming

Assignment Help Basic Computer Science
Reference no: EM131339314

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?

Reference no: EM131339314

Questions Cloud

Send an email message in html format : When you send an email message in HTML format, you should also send it in text format for all but one of the following reasons. Which one is it?
What is the farmer’s maximum profit : If the farmer plants at least 2 acres of corn for every acre of soybeans, how many acres of each should he plant to earn the greatest profit?
Discuss how group uses social influence such as conformity : Discuss how the group uses social influence such as conformity, compliance, and obedience to keep members in the group, gang, or cult
Is this an effective tactic for spreading terror : In your opinion, do you think that terrorists are primarily motivated by religious beliefs or ideologies (political orientations)? Explain.What types of terrorist attacks do you think are the most effective? Why? Be specific.Have you ever felt fear..
Object-oriented programming : 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
What is the profit if the plant maximizes processing : The profit is $17.50 per ton for processing food containers and $20 per ton for processing drink containers. What is the profit if the plant maximizes processing?
Prepare confidence intervals for the proportion of students : Develop 95% confidence intervals for the proportion of all students, the proportion of all male students, and the proportion of all female students who were involved in some type of cheating.
Create a java class for the max heap data structure : Create a Java class for the Max Heap data structure. Implement the heap as an array. You will needto keep track of the heap size with a private variable. Implement an adequate constructor and agetter method for the size.
Explaining why the study of psychology is important : Complete your presentation by explaining why the study of psychology is important in this program of study.  In other words, what skills did you learn in this course that will be useful when dealing with co-workers, clients, or even your own stren..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Why are protocols needed

In a LAN with a link-layer switch (Figure 1.8b), Host 1 wants to send a message to Host 3. Since communication is through the link-layer switch, does the switch need to have an address? Explain.

  What do you mean by re-usability

What do you mean by re-usability

  Final project plan

Final Project Plan

  Horizontal force p needed to push the beam

The 1.2-Mg steel beam is moved over a level surface using a series of 30-mm-diameter rollers for which the coefficient of rolling resistance is 0.4 mm at the ground and 0.2 mm at the bottom surface of the beam

  Difference between function and stored procedure

What is Difference between Function and Stored Procedure?

  Write a program that instantiates objects of your classes

Write a program that instantiates objects of your classes and outputs each object's area (except Quadrilateral).

  Online search for a good or service offered

Online search for a good or service offered in another country

  Convert this cfg to one with-out the lambda-production then

convert this CFG to one with-out the lambda-Production then.

  Pascal triangle and binomial theorem

Write the geometric sequence that has four geometric means between 1 and 7,776? Find the sum of the first 40 terms of the arithmetic series: -5, -4, -3, -2, -1, ? Use pascal's triangle and binomial theorem to expand (x-2)^5?

  Which component of the total delay is dominant

The length of the link is 2000 Km. The speed of light inside the link is 2 × 108 m/s. The link has a bandwidth of 5 Mbps. Which component of the total delay is dominant? Which one is negligible?

  Write a function named location_of_largest

then the function should return the integer 2 as its value. If there is more than one cell containing the largest of the values in the array, then the function should return the smallest of the subscripts of the cells containing the largest values..

  Understand that piracy of copyrighted works

Most people understand that piracy of copyrighted works is illegal. But, many do not understand what piracy is or whether their role in the act of downloading pirated materials is a crime.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd