Question: ** We are given 3 individual data files(full.tx, uk.txt, us.txt) of numbers to read from. The user needs to choose one . ** To avoid

** We are given 3 individual data files(full.tx, uk.txt, us.txt) of numbers to read from. The user needs to choose one. **

To avoid the user having to type in a path other than the file names, the data files should be downloaded and placed in the NetBeans project folder.

Getting Started: Basic NetBeans Java Application Project Information Create a new NetBeans Java application project and name it pp2_your-clid-or-ulid. As part of the project, NetBeans will create package pp2_your-clid-or-ulid and class Pp2_ your-clid-or-ulid (this in file Pp2_ your-clid-or-ulid.java). Under the Projects tab on the left, right click on the package and select New, Java Class. Name this class an appropriate name for a class that will keep track of a single temperature reading and click Finish. This will create the class as you named it in a ".java" based on the name you used and will be located within package pp2_your-clid-or-ulid. CMPS 260 Fall 2017 Programming Project #2 (2017-11-15) 3

Step One: Practice Reading the File Data In order to be certain that you program will read in the data correctly, write practice code in method main that echoes the contents of one of the data files to the terminal screen.

Step Two: Code and Test the Temperature Reading Class The temperature class must contain data members (fields) that maintain the state information about a single temperature reading. latitude (a double) longitude (a double) year (an int) month (an int) maximum temperature (a double) minimum temperatures (a double) average temperature (a double) Temperature Reading Class Design Requirements All class data members (fields) must be private. All class data members (fields) must be initialized to default or neutral values as appropriate. For example: -na- or "unknown" could be used for strings, false or true for Booleans, and a larger that possible negative number. All class data members (fields) must have getter (accessor) methods. The class will be immutable. This means that there will be no setter (mutator or manipulator) methods. The class must have a default constructor and a parametrized constructor. A call to a constructor with operator new must result in all class data members (fields) being initialized. The class may not include any input or output. Data may be passed in as a parameter to a method or constructor or returned by a method. Class data members (fields) must not depend on external to the object storage. I. e. a class data member can be initialized by a value passed to a constructor or a setter, but all getters must be NOT be passed any values and must return the values stored in the class data members (fields) without being dependent on any data stored outside of the object. No method or data members of the class may be static.

Step Three: Write the Solution code in Pp2_your-id.java Create a menu driven system that on startup uses a try-with-resources to read in the "temperature reading" data stored from the file chosen by the user, storing each line of data in a new temperatures reading class object and adding all such objects to an ArrayList, then presents the user with a menu of possible selections for analysis of the data stored in the ArrayList. The menu will have the following selection options: show the average (mean) temperature of all average (mean) temperatures stored in the ArrayList show the average (mean) temperature of all average (mean) temperatures stored in the ArrayList for all locations within user entered latitude and longitude ranges show the average (mean) temperature of all average (mean) temperatures for all instances of a specific year stored in the ArrayList show the highest temperature recorded of all temperatures stored in the ArrayList show the lowest temperature recorded of all temperatures stored in the ArrayList after each user selection from the menu and response by the program, the menu is represented until the user selects the option to exit the program All data analysis must be performed when the user requests it from the data in the ArrayList. Objects must be directly accessed via the ArrayList during the requested analysis. For example, no dumping to alternative data structures (such as an array) is allowed allowed.

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!