Weather Professing System Java Homework 5

1CSCE 155ASpring 2016Homework Assignment 5: 
Weather Data Processing SystemAssigned: Monday, March 28, 2016Due: Monday, April 11, 2016Note: This assignment is to be completed individually - collaboration is strictly prohibited.Points: 100 pointsObjectivesThe objectives of this homework assignment:

Familiarize with the use of arraysa. Manipulate a collection of data values (objects) using an arrayb. Compute statistics out of an array of valuesc. Declare and use an array of reference data types

  • Familiarize with the use of exception handling for data format and range checking

  • Master the use of standard Java classesa. How to find out what these classes are through the online Application ProgramInterface (API)b. How to find out about the data members of these classes through the online APIc. How to find out how to use the methods of these classes through the online API

  • Understand the concept of object-oriented programming.a. How one class uses another class elegantly!b. Understand the concepts of object instantiation.

  • Familiarize with methodsa. How to use the results of one method in another method

  • Use existing classes

  • Familiarize with code documentation, compilation, and execution

  • Expose to Java syntax, programming styles, and Java classesProblem DescriptionFor this homework assignment, you are to create an application to process weather data. In orderto do this, you will need to create a weather data class that stores the recorded weather data for aspecific day at a specific location. You will use this class to create objects that you store in anarray for the processing application. You will be required to get the data from a supplied dataloading class and store the weather data objects for the entire year of 2008 at four locations in asingle multi-dimensioned array. The weather data processed in the system should be stored inJava arrays. 



Note: You cannot use JCF classes or any standard classes to store the weather dataobjects.2You are given the following set of minimum requirements to design and implement the weatherdata class that stores the recorded weather data for a specific day at a specific location.

The class should be able to store the following attributes:
a. Location (String)
b. Date (Gregorian Calendar)
c. High Temp (Integer)
d. Low Temp (Integer)
e. Average Wind Speed (Integer)
f. Max Wind Gust (Integer)
g. Precipitation (Double)
All data values should have “get” and “set” methods for storing and accessing the data ofthe class.
This class should be able to nicely “print” itself.You are given the following set of requirements to design and implement the overall weather dataprocessing application.
1. First, your system will need to load the weather data from a supplied class calledWeatherDataLoad.java into your array of objects. This class has all the individualdata values for the High Temp, Low Temp, Average Wind, Max Wind, and Precipitationstored in order by location by date. You will need to review this class, understand how itworks, and call its methods in order to load all of your Weather Data objects with theappropriate data. Data in the WeatherDataLoad.java class represent all of theweather data from 2008 for the following four towns/cities: Eagle, NE; New York, NY;Houston, TX; and LA, CA. The data is ordered for each attribute starting with Eagle, NEon January 1st, 2008. It has the full year of Eagle’s data before it moves on to NY’s data.NY’s year of data is followed by Houston’s data and all of the data ends with LA, CA onDecember 31st, 2008. Please keep in mind that, like this year, 2008 was a leap year, sothere is 29 days worth of values for February for each town/city.

2. You should store all of the weather data in a single three dimensioned array. This arraywill have an individual weather data record object for each day (up to 31) for each of thetwelve months for each of the four cities. The weather data processed in the system shouldbe stored in Java arrays. Note: You cannot use JCF classes or any standard classes tostore the weather data objects. You are also expected to properly handle any exceptionsthat could be thrown during the processing of your array.

3. Once the data is loaded, then the user should have some options for processing the weatherdata. This should be a “menu” of choices for the user to choose from and the user shouldbe able to continue to use the overall program until they decide to quit. You are alsoexpected to properly handle any exceptions that could be thrown during the processing ofuser input/entry. The main menu will need to support the following features:a. Weather Record: The user should be able to enter a date (MM/DD/2008) and seethe weather record for all four locations for the specified date. Once selected, thisoption should repeat allowing the user to enter in another date.


3b. Averages: The user should be able to select a data value (High Temp, Low Temp,Average Wind, Max Wind, and Precipitation) for which they want to see theaverages printed for each month for each location. Once selected, this option shouldrepeat allowing the user to enter in another data value. All resulting averagedvalues should be displayed to only four decimal places.c. Maximums: The user should be able to select a data value (High Temp, LowTemp, Average Wind, Max Wind, and Precipitation) for which they want to see themaximum amounts printed for each month for each location. This option shouldrepeat allowing the user to enter in another data value. If Precipitation is selected,the resulting values should be displayed to only two decimal places.d. Minimums: The user should be able to select a data value (High Temp, Low Temp,Average Wind, Max Wind, and Precipitation) for which they want to see theminimum amounts printed for each month for each location. This option shouldrepeat allowing the user to enter in another data value. If Precipitation is selected,the resulting values should be displayed to only two decimal places.e. Total Precipitation: The user should be able to select a location and see the totalrain fall for each month over the entire year. This option should repeat allowing theuser to enter in another location. All resulting totaled values should be displayedto only two decimal places.f. Extremes: The user should be able to select a location and see the extreme valuesfor each of the following data values: show the highest High Temp recorded (andthe date it occurred), the lowest Low Temp recorded (and the date it occurred), thehighest Max Wind recorded (and the date it occurred), and the largest amount ofPrecipitation recorded (to two decimal places) (and the date it occurred) for thespecified location. This option should repeat allowing the user to enter in anotherlocation.



4. All data values should have “get” and “set” methods for storing and accessing the datavalues of the class.To do this, you need to program a Weather Processing System using solid object orientedprogramming methodologies.Sample RunHere is a sample run of the Weather Processing System:Welcome to Weather Data Processing System!You can process weather information using this system.Please select a feature you wish to use from the following:1. Weather Record2. Averages3. Maximums4. Minimums5. Total Precipitation6. Extremes0. Quit4Selection: 1Please enter a date to view (MM/DD/2008, 0 to Quit):06/05/2008Location: Eagle, NE Date: June 5, 2008High Temp: 81 Low Temp: 64Avg Wind: 20 Max Wind: 58Precipitation: 0.71 inchesLocation: New York, NY Date: June 5, 2008High Temp: 73 Low Temp: 62Avg Wind: 2 Max Wind: 28Precipitation: 0.02 inchesLocation: Houston, TX Date: June 5, 2008High Temp: 91 Low Temp: 79Avg Wind: 11 Max Wind: 28Precipitation: 0.15 inchesLocation: LA, CA Date: June 5, 2008High Temp: 77 Low Temp: 55Avg Wind: 2 Max Wind: 16Precipitation: 0.00 inchesPlease enter a date to view (MM/DD/2008, 0 to Quit): 0Please select a feature you wish to use from the following:1. Weather Record2. Averages3. Maximums4. Minimums5. Total Precipitation6. Extremes0. QuitSelection: 0Thank you, goodbye!5Supplied Solution ComponentsThe weather data processing system will require weather data. A data class has been created foryou from which to pull the weather data. This class is called WeatherDataLoad.java. It hasall the individual data values for the High Temp, Low Temp, Average Wind, Max Wind, andPrecipitation stored in order by location by date. They are stored in single arrays by data value.This class also has getters to get the information from each of the arrays by index. You will needto review this class, understand how it works, and call its methods in order to load all of yourWeather Data objects with the appropriate data. Data in the WeatherDataLoad.java classrepresent all of the weather data from 2008 for the following four towns/cities: Eagle, NE; NewYork, NY; Houston, TX; and LA, CA. The data is ordered for each attribute starting with Eagle,NE on January 1st, 2008. It has the full year of Eagle’s data before it moves on to NY’s data. NY’syear of data is followed by Houston’s data and all of the data ends with LA, CA on December 31st,2008. Please keep in mind that 2008 was a leap year, so there is 29 days worth of values forFebruary for each town/city. The main (application) class for the program should be calledWeatherProcessingSystem.java.Submission ProcedureThis assignment is due Monday, April 11, 2016 at the start of class (1:30 PM). Assignmentsfive minutes late will not be accepted. It is highly recommended you read the grading policy andgrading guidelines on BlackBoard for a complete explanation of how assignments will be graded.Remember, your program should follow good programming style, include plenty of comments(including appropriate javadocs), and perform all of the functionality outlined above.After completing the assignment, you must “handin” the following files online. Please hand in thefiles as individual files and not as a compressed/combined file.1. Source files: WeatherProcessingSystem.java, and all other programmerdefinedsource files (classes) created/used for the program.2. Readme file: README.TXT (See Homework #1 for what should be included)3. Testing file: TEST (See Homework #1 for what should be included. Be sure to includemultiple tests and an explanation (test case) for each of the tests you run.)In addition, you must submit a stapled paper copy of your README file and TEST file. Both ofthese steps must be done by the start of the class on the day the assignment is due. Together withyour paper copy, you must attach a coversheet. (Please download this coversheet from theBlackBoard course website, under the “Assignments” link). This coversheet allows the grader togive comments and categorize the points for your homework.Appendix1. Average of n values is defined as
Powered by