Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
EECMS Programming Design and Implementation
(COMP1007/5011) Semester One, 2021 Please carefully read this front cover. Incorrectly following these steps may result in penalties. This is an OPEN BOOK assessment. There are two (2) questions. Answer both questions. There are 100 marks available. It is recommended that you write in Vim (Terminal Text Editor) on either the Linux Labs (remotely) or the VDI solution (https://mydesktop.curtin.edu.au), or your own version of Linux. Your code needs to run on the VDI/lab machines. Your code needs to conform to practices emphasised in the lectures and practicals. You must work alone on this assessment. You must not communicate with anyone other than your Lecturer/Unit Coordinator regarding any aspect of this Assessment. You must cite all code you have used from external sources. You may use any code you have written this semester within this assessment, including code from your other assessments. All provided practical and lecture code may be used. • Create a directory for Question One and Question Two and store all answers in the corresponding directory; • For question one pseudocode, title files in this way: Question_one_partA.txt; • For question one Java code, title files in this way: Question_one_partA.java • For Question two, please title files appropriately; • Upon Completion, zip the two directories listed above into a single file that includes your Declaration of Originality and submit the single zipped file to Blackboard. CRICOS: 00301J COMP1007/5011 Final Assessment QUESTION ONE [30 marks] a) Rewrite the following algorithm to use a DO-WHILE loop rather than a WHILE loop [3 marks]. INPUT age WHILE age <= 0 PRINT “Age is not valid!” INPUT age ENDWHILE b) Convert this algorithm into a working Java program. For this algorithm, everything should be contained in main() [5 marks]. c) Create an algorithm in pseudocode that receives 10 integers from the user (not a file). Each integer must be even. The integer must be even to count as one of the 10 integers. Print to the user, the sum and average of the 10 integers input [5 marks]. d) Convert the algorithm you wrote in part c) into a working Java program [9 marks]. e) Create an algorithm in pseudocode that calculates the area of a square from the input provided by the user and then displays this back to the user [3 marks]. f) Convert the algorithm you wrote in part e) into a working Java program [5 marks]. CRICOS: 00301J Page of 1 3 COMP1007/5011 Final Assessment QUESTION TWO [70 marks] The company you work for has been contracted to develop a small program that will assist in understanding weather data from the Australian Bureau of Meteorology (BOM). The data you are provided with is a csv file that contains temperature data from weather stations located around Australia. A screenshot showing a sample of the data is below: a) In pseudocode design a WeatherData class that has the following class fields: code (String) stationNumber (String) year (integer) month (integer) day (integer) maxTemp (real number) The class should contain the 3 constructors discussed within the unit along with accessors and mutators for each class field, a toString() and an equals() method as well as a formattedDate() method the returns a string formatting the date as follows: ’day/month/year’ [20 marks]. b) Using the WeatherData class from question two part a), design an algorithm that will ask the user for the data file that will be loaded, read the file and load each line of the csv file into a WeatherData object within an array of WeatherData objects. You should ignore the Days of accumulation and Quality columns when loading the data. If data required for the WeatherData object is absent from a data row, for example, the maximum temperature is missing, omit that row completely. Keep track of the number of rows that are omitted as you will need to present this to the user at the end. You CRICOS: 00301J Page of 2 3 COMP1007/5011 Final Assessment need to sort the WeatherData data in the array based on temperature, from highest to lowest. Your program will tell the user the total number of rows in the file (not including the header row) as well as how many invalid rows of data there were. It will tell the user the maximum temperature, including all the details from the object(s) with the maximum temperature. It will tell the user the minimum temperature, including all the details from the object(s) with the minimum temperature. Your program will also give the user the ability to enter a specific month and provide the average temperature for that month from all of the data [15 marks]. c) Convert your pseudocode from question two parts a) and b) into a working Java Application. The array size should be dynamically allocated [45 marks]. Suggested way for your interface to look (please note, the user interface provides some more information about how your program will function): Welcome to the BOM Weather Station Application. Please enter the name of the data file or x to exit> [file name or x] The data file contains 13246 entries. There were 1344 incomplete data entries. Details of the maximum temperature: 48.8 degrees on 31/12/2003 Details of the minimum temperature: 8.8 degrees on 31/1/2021 What month would you like to know the average temperature for? > [month] The average temperature for month [month entered] was: 31.5 Welcome to the BOM Weather Station Application. Please enter the name of the data file or x to exit> [file name or x] … As you can see, the program loops until the user selects exit. The square brackets [] indicate where the user will enter something into the program or the program displays what the user has entered.