UNIVERSITY OF SOUTHERN QUEENSLAND CSC1401 - Foundation Programming (Semester 1, 2020) Assignment II Specification Australian Coronavirus Confirmed Cases Calculator Due date: 23 April 2020 Weight: 12%...

[email protected]
Due by 23/04 1pm AEST


UNIVERSITY OF SOUTHERN QUEENSLAND CSC1401 - Foundation Programming (Semester 1, 2020) Assignment II Specification Australian Coronavirus Confirmed Cases Calculator Due date: 23 April 2020 Weight: 12% Type: Individual Goals and Topics The assignment problem is straightforward. All necessary details have been supplied. The solution of the problem will use the programming concepts and strategies covered in Workshops 1-7. The subgoals are:  Obtaining advanced understanding of values, variables and arrays;  Understanding program input and output, functions and expressions;  Understanding simple strategies like iteration, validation plans;  Translating simple design into Pseudocode then JavaScript code  The mechanics of editing, interpreting, building, running and testing a program  Commenting source code  Becoming confident and comfortable with programming in small problems Background According to Australian Government Department of Health (Website link), as at 6:00am on 25 March 2020, there have been 2,252 confirmed cases of COVID-19 in Australia. There have been 429 new cases since 6:00am yesterday. The number of confirmed cases on 25 March 2020 is as Table 1 on page 2. Your Task In this assignment, you will design and implement an Australian Coronavirus Confirmed Cases (ACCC) calculator program for client that allows users to input the state/territory name and the number of confirmed cases, then calculate the total number of confirmed cases and average number of confirmed cases accordingly. https://www.health.gov.au/news/health-alerts/novel-coronavirus-2019-ncov-health-alert/coronavirus-covid-19-current-situation-and-case-numbers Table 1: Australian confirmed cases of COVID-19 on 25 March 2020 Functional Requirements The program should be implemented in JavaScript and running on Firefox, a web browser independent to operating systems. The client has specified the following requirements for the functionality of the program: 1. The program should be running without errors throughout two Phases: Information Gathering and Information Presenting. 2. Information Gathering is to gather the information such as state/territory name and the corresponding confirmed cases for calculation of ACCC; 3. The program should first confirm with the user for willingness of entering a new state/territory before proceeding to gather information of the state/territory name and confirmed cases for calculation. 4. When receiving a new entry for a state/territory, the program should first prompt and ask the user to enter the state/territory name. If the user enters nothing or an invalid state/territory name, the program should alert an error message on screen and then prompt the user to re-enter. The process should iterate until a valid state/territory name is entered. 5. If the entered state/territory name is valid, the program should then prompt the user to input the corresponding confirmed cases for the state/territory. Again, if nothing or an invalid value is entered, the program should display an error message then iterate until receive a valid number of confirmed cases. 6. After valid input of state/territory name and the confirmed cases, the program should loop back to seek user confirmation for either proceeding to add one more state/territory or moving to the Information Presenting phase to calculate and display the results; 7. If the user confirms no more state/territory to enter, the Information Gathering phase is completed and the program then moves to Information Presenting. 8. In the Information Presenting phase, the program prints on the web page a table containing all entered state/territory(s), including information such as state/territory name and the confirmed cases. 9. To make the ACCC calculator user-friendly, the client also expects the program to display some statistic information: - The state/territory(s) with the largest number of confirmed cases; - The total confirmed cases for the entered state/territory(s); - The average number of confirmed cases for the entered state/territory(s). Respectively, Figure 1 and 2 illustrate the dataflow in Information Gathering and a sample result presented to the web browser in Information Presenting. Implementation Task 1 - A Validation Plan for state/territory name You need to implement a validation plan to get a valid input from the user for state/territory name. A valid state/territory name needs to satisfy ALL the following criteria: - The input should be one of the states/territories (New South Wales, Victoria, Queensland, South Australia, Western Australia, Tasmania, Northern Territory, Australian Capital Territory). - The state/territory name should be case-insensitive. Task 2 - A Validation Plan for the confirmed cases of entered state/territory You need to implement another validation plan to get a valid input from the user for confirmed cases of entered state/territory. A valid input needs to satisfy the following criteria: it is a non-negative integer number. Task 3 - An Iteration Plan for Information Gathering Phase You need to design an iteration plan to implement the Information Gathering Phase. Refer to Functional Requirements and Fig. 1 for the detail of dataflow in iteration. Clearly, this task should incorporate the works in Task 1 and 2. Task 4 - A Maximum Plan to find the state/territory with the largest number of confirmed cases Your program needs to find the entered state/territory with the largest number of confirmed cases. Task 5 - Sum, Count, Average Plans to calculate the number of confirmed cases Your program needs to be able to calculate the average number of confirmed cases for all entered state/territory(s). The task includes: - a sum plan to accumulate the confirmed cases of all the entered state/territory(s); - a count plan to count the number of state/territory(s) being entered; - an average plan to calculate the average number of confirmed cases of all the entered state/territory(s); - handling the “Division by Zero” exception when calculating average. Task 6 - Presenting the Detailed Information Print to a table the detailed information of entered state/territory(s) including the state/territory name and the confirmed cases. - The state/territory(s) should be presented with all upper case letters. - They are listed in ascending order according to the confirmed cases of entered state/territory(s) even the state/territory with the smallest number of confirmed cases is not entered as the first input (challenge task). Figure 1: Dataflow in Information Gathering Task 7 - Presenting the Statistics Print to an unordered list the statistic information of - the state/territory with the largest confirmed cases; - the total confirmed cases of entered state/territory(s); - the average confirmed cases of entered state/territory(s) and it is an integer value; The state/territory name should be presented with all upper case letters. The table and the list should be formatted like the screenshot in Figure 2. Figure 2: Sample Output of the Program Program Integration Test You need to test the program for all functionality thoroughly before delivering the program to client. The program should be running appropriately without any syntax or logic errors. Non-Functional Requirements  All code should appear in the script section in the head of the HTML document. Do not write any code in the HTML body. All functionality are delivered by JavaScript.  In the script arrange your code as in the following order: (a) Constants; (b) Variables and objects (declared and initialized); (c) Other statements.  Variable and constant identifiers should follow appropriate conventions.  Code is indented appropriately and grouped in blocks according to the common tasks attempting to.  Appropriate comments should be added to all blocks of code. Do not simply translate the syntax into English for comments, instead, describe the purpose of the code. Submission What You Need to Submit - Two Files. For a complete submission you need to submit two files as specified below. The assignment submission system will accept only the files with extensions specified in this section. 1. Pseudocode in a file saved in .doc, .docx or.pdf format: -The pseudocode should be completed before JavaScript code. -The pseudocode should be succinct and accurate. Refer to workshop 6 course materials. -The pseudocode should be presented logically and clearly. 2. The program in a file saved with an .html extension contains the source code implemented following the functional and non-functional requirements. Suggested Strategy Plan to complete the assignment on time. Do not write all of the code in one sitting and expect that everything will be working smoothly like a magic. First step Read assignment specification carefully; clarify anything unclear by putting a post on the assignment forum; think about how to do it, how to test it, devise high-level algorithms for each independent part of the assignment. Begin to write program (with comments), in incremental stages. Seek help on the assignment forum if needed. Second step Re-read the specification carefully. Try to implement the function in one task a time, test it and make sure it works as expected before move to next task. Integrate all functions and finish initial coding. Third step Fully test the program; have another review on the source code; re-read the specification (especially marking criteria) to make sure you have done exactly what is required. Complete the "Statement of Completeness". Plagiarism and Academic Misconduct USQ has zero tolerance to academic misconduct including plagiarism and collusion. Plagiarism refers to the activities of presenting someone else's work as if you wrote it yourself. Collusion is a specific type of cheating that occurs when two or more students exceed a permitted level of collaboration on a piece of assessment. Identical layout, identical mistakes, identical argument and identical presentation in students' assignments are evidence of plagiarism and collusion. Such academic misconduct may lead to serious consequences, such as:  Required to undertake additional assessment in the course  Failed in the piece of assessment  Awarded a grade of Fail for the course  Withdrawn from the course with academic penalty  Excluded from the course or the program for a period of time Refer to USQ Policy \Academic Misconduct" for further details. Late Submission and Extension Request Please refer to USQ Policy Library - Assessment Procedure for information on the late submission policy and USQ Policy Library - Assessment of Compassionate and Compelling Circumstances Procedure for considerable special circumstances in extension request. The Extension Request Form is available on the course's StudyDesk. Should you need to request an extension please fill the form and email it to the Course Examiner with supportive documents (e.g., medical certificate or endorsement letter from supervisor in workplace) prior to the due date. Please note that any requests without supportive documents will be rejected directly. Marking Criteria The assignment will be marked out of 24 and
Apr 20, 2021CSC1401
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here