Advanced Programming
PA2 - Let it Rain
Software Requirements Specification
Due Wednesday February 12, 2014 11:59pm
Introduction
Purpose: The National Oceanic and Atmospheric Administration (NOAA) collects weather data from stations around the county. Your job is to build a class that will store and then produce data about rainfall from a particular weather station. This data consists of daily rainfall totals.
Objectives - At the conclusion of this exercise the student will demonstrate that they can:
- Create a class based on a specification.
- Create methods that conform to a specific interface.
- Manipulate a 3 dimensional array.
- Generally practice skills learned in the introductory programming course.
- READ AND FOLLOW DIRECTIONS!!!!!
Deadlines
- The Rainfall.java file must be submitted to the submit system no later than 11:59pm on February 12 for full credit.
Program Structure
You will write code in a single class, the Rainfall class. This class will contain the following attributes:
- A 3 dimensional matrix of rainfall data. The first dimension is the year of the data, the second is the month, and the third the rainfall for the day. Rainfall data is stored as double values representing rainfall in inches.
- An integer variable that represents the starting year for the data.
- A String, which contains the station for this rainfall data.
This class will contain the following methods (See the documentation for the Rainfall class for more detail about the method requirements.:
- A constructor that takes in a 3 dimensional array of rainfall data along with a beginning year and station name.
- An accessor method, getYear, to get the starting year value.
- A public met hod averageRainfall that takes in no parameters and returns the average annual rainfall for all of the years in the rainfall array.
- A public method averageRainfall that takes in an integer parameter representing a month and returns the average monthly rainfall for that month across all years. January would be entered as month 1.
- A public method recordHigh that returns a String representing the date of the highest rainfall amount and that amount.
- A public method totalRainfall that takes in no parameters and returns an array of the total rainfall in inches by year starting with beginYear.
- A public method getRainfall that takes in a month, day, and year, and returns the total rainfall for that day in inches.
- A toString method that takes in no parameters and returns a String representing a list of each year and the days with rain.
We are providing a Rainfall.java starter and RainfallDriver.java program to help you get started. One set of data is found in the file Rainfall.csv. For Eclipse, this data file should be placed at the top level of the project folder. Note that the incoming data file name is entered as an argument to the main method. For Eclipse, you can go to Project/Preferences/Run/Debug and update the arguments in the run settings or simply run the program from the Command Line..
Output and Error Handling
See each method documentation for appropriate error handling.
Additional Application Requirements
- Any additional methods that you add should be made private.
- Your program must conform to standard Java programming standards and the additional standards for this class. See the Style Guide for your class.
- You should, for your own benefit, write a tester that will test the various methods that you are building and the classes that you are using. This would be a good chance to practice using JUnit testing within Eclipse.
- You are NOT required to submit a tester program. All testing will be done by the instructor reference tests.
- You must submit your Rainfall.java and ack.txt to the submit system as 'submit pa2'
Honor Code
This work must conform to the JMU Honor Code and the specific requirements of this class. NO help may be provided by any student to another student. Authorized help is limited to your textbook, the TAs for any CS159 section, and the professor for your section. Be sure to acknowledge any help that you do receive from a TA or internet sources (like StackOverflow).
Grading
- Your program will be evaluated both on its correctness and conformance to the required Style elements.
- You will achieve a grade of 70 points for a program that runs correctly and produces exactly the required output in the required format on time. IMPORTANT: For submit, your program must successfully pass ALL tests. No partial credit will be awarded.
- The remainding 30 points will be based on your conformance to the Style Guide and other requirements of the assignment. Review the Style Guidebefore submitting your program and the grade sheet which is produced by the submit system.
- All grades will be based on 100 points.
- For sections 1, 4, and 5, by 8am of the next class day after you have submitted, you must upload the PDF file of the submission you wish graded to Canvas (sections 1, 4, or 5). For sections 2 and 3, bbring a stapled hardcopy of the PDF file to turn in at the beginning of class. You may submit any number of times but excessive submissions may result in a deduction of points. Programs should be fully debugged before submitting.
- The version that you turn in is the version that will be evaluated for style. Make sure it has no line wraps or other spacing issues.
- Successfully submitted
programs that are late will be graded, then the late penalty is
assessed for each day late according to the following schedule.
- Thursday Feb 13 - 5pts
- Friday Feb 14- 10 pts
- Saturday Feb 15- 15 pts
- Sunday Feb 16 - 20 pts
- Monday Feb 17 - 40 pts
- Tuesday Feb 18 - 60 pts
- Wednesday Feb 19 - 100 pts
HINTS
- Start early. Work through each method and test as you are going along.
- Use a small file (a subset of the data provided) to do your initial tests.
Last updated: 02/04/2014