Assessment item 2— Assignment 2
Due date:
Thursday of Week 10
Weighting:
30%
Length:
NA
ASSESSMENT
2
Objectives
This assessment item is designed to test your understanding of arrays/arrayLists, objects, classes, sorting and searching.
Assessment task
Write a java application that allows the user to read, display, sort, and search the city (type String), and weather condition data (defined by the low temperature, high temperature and humidity, all integer types) for N cities in Australia. N should be declared as a constant and should be either
equals to the largest digit of your student ID number or N=5 (if the highest digit of your student ID number is less than 5). The city name and weather condition data must be stored in separate single dimension arrays/arrayLists. This requires that your implementation must use parallel arrays (or arrayLists). If there are any uses of an array of records or structures/objects, it will be penalized under the heading “Using techniques not covered in the course.” The ranges for these weather condition data should be are in -20∼20, 0∼60 and 10% ∼100% respectively. These data must be entered from the keyboard and a validation for minimum and maximum values for each weather condition data variable must be done. In addition, the high temperature must be greater low temperature in the single set input for a city. Your application should display and execute a menu with the following options. A switch statement must be used to execute the following menu options.
1. Input data
2. Display
3. Sort by city
4. Sort by low temperature
5. Search
6. Display extreme temperature
7. Exit
The details for each option are described as below.
1. Input data
This option reads city name and weather condition data for N cities from the keyboard and stores them in separate single dimension arrays/arraylists. Figure 1 shows a sample input for a city. If the