Design an australian population calculator program

Assignment Help Computer Engineering
Reference no: EM131965084

Foundation Programming Assignment: Australian Population Calculator

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-6. 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, sum, count, minimum, and maximum plans;
• Translating simple design into 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 Bureau of statistics, on 7 April 2018 at 12:27:29 PM (Canberra time), the resident population of Australia is projected to be: 24,896,222. This projection is based on the estimated resident population on 30 September 2017 and assumes growth since then with assumptions which are consistent with figures released in Australian Demographic Statistics, September Quarter 2017 (cat. no. 3101.0). The Australian population on 30 September 2017 are as Table 1.

Your Task

In this assignment, you will design and implement an Australian population (AP) calculator program for client that allows users to input the state/territory name and the population, then calculate the total population and average population accordingly.

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 population for calculation of AP;

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 population 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 state/territory name is entered.

5. If the entered state/territory name is valid, the program should then prompt the user to input the population 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 population value.

6. After valid input of state/territory name and the population, 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 population.

9. To make the AP calculator user-friendly, the client also expects the program to display some statistic information:

- The number of state/territory(s) that the user has completed and entered;

- The state/territory(s) with the largest population;

- The state/territory(s) with the smallest population;

- The total population for the entered state/territory(s);

- The average population 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 OR abbreviations (New South Wales, Victoria, Queensland, South Australia, Western Australia, Tasmania, Northern Territory, Australian Capital Territory, NSW, VIC, QLD, SA, WA, TAS, NT and ACT).

- If user have inputted New South Wales, the NSW will be an invalid input or if user have inputted NSW, the New South Wales will be an invalid input, so do other states/territories.

- The state/territory name should be case-insensitive.

Figure 1: Dataflow in Information Gathering

Task 2 - A Validation Plan for the population of entered state/territory

You need to implement another validation plan to get a valid input from the user for population of entered state/territory. A valid input needs to satisfy ALL the following criteria:

- it is a number;

- it is an integer value between 200,000 and 9,000,000.

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 population

Your program needs to find the entered state/territory with the largest population.

Task 5 - A Minimum Plan to find the state/territory with the smallest population

Your program needs to find the entered state/territory with the smallest population.

Task 6 - Sum, Count, Average Plans to calculate the state/territory population

Your program needs to be able to calculate the average population for all entered courses. The task includes:

- a sum plan to accumulate the population 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 population of all the entered state/territory(s);

- handling the \Division by Zero" exception when calculating average.

Task 7 - Presenting the Detailed Course Information

Print to a table the detailed information of entered state/territory(s) including the state/territory name and the population.

- The state/territory(s) should be presented with all upper case letters.

- They are listed in descending order according to the population of entered state/territory(s) even the state/territory with the largest population is not entered as the first input (challenge task).

Task 8 - Presenting the Statistics

Print to an ordered list the statistic information of

- how many state/territory(s) having been entered;

- the state/territory with the largest population;

- the state/territory with the smallest population;

- the total population of entered state/territory(s);

- the average population 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.

Attachment:- Assignment-Specification.rar

Reference no: EM131965084

Questions Cloud

Summarize the steps followed by the crime scene investigator : Summarize the steps followed by the crime scene investigators including the mistakes and/or correct steps followed to process.
Find the worth of the put option : The current stock price of Johnson & Johnson is $74, and the stock does not pay dividends. The instantaneous risk-free rate of return is 4%.
Operate without traditional budgets : Do you think that an organization could operate without traditional budgets? If so, what might be used instead? And which references you based your answer on?
Substitute for bank borrowing in fueling growth : How do you see the role of corporate bonds as a substitute for bank borrowing in fueling growth? and what references you based your answer on?
Design an australian population calculator program : You will design and implement an Australian population (AP) calculator program for client that allows users to input state/territory name and the population.
Write a PLpgSQL function that takes a staffs id : PostgreSQL Database System Assignment - Project 2 PLpgSQL. Please write a PLpgSQL function Q2(staff_id integer) that takes a staff's id as parameter
How does a not-for-profit firm differ from all the other : In terms of Ownership/Governance, how does a Not-For-Profit firm differ from all the other firms we have discussed in LBS?
Substitute for bank borrowing in fueling growth : How do you see the role of corporate bonds as a substitute for bank borrowing in fueling growth? and what references you based your answer on?
What is the net present value of project : The tax rate is 35%. If the firm requires a 10% rate of return, what is the Net Present Value of this project?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Assess the security risks

As part of your project in order to assess the security risks in order to compute the infrastructure, you have discovered that other managers often have several ideas on the severity and levels of the risk.

  Design a dedicated datapath for inputting three 8-bit

design a dedicated datapath for inputting three 8-bit unsigned numbers and then output the. largest number followed by

  Develop a simplified P2P file sharing system

In this part, you are to develop a simplified P2P file sharing system. The assumptions on the system are specified as follows

  Explain an instance of a two-dimensional character array

describe an example of a two-dimensional character array that could be used to hold a set of text data that might be

  How to construct a permutationgenerator object

note down  a program that produces random permutations of the numbers 1 to 10. To generate a random permutation, you need to fill an array with the numbers 1 to 10 so that no two entries of \array have the same contents.

  Prepare some xhtml notes by listing tags and attributes r

Prepare some XHTML notes by listing the tags and attributes related to forms found on your sample page along with a brief description of their purpose.

  How does the device file help in accessing the device

How does the device file help in accessing the device? Which of these commands will work? Explain with reasons mkdir a/b/c and mkdir a a/b.

  Why use asymptotic notation instead of running time

Why use asymptotic notation instead of running time or operation counts and when does it make more or less sense?

  Calculate the number of each kind of transformation

Give a general fondle to calculate the number of each kind of transformation and the number of total transformations for each version of AES.

  Design an application that will receive the weight of parcel

You will need to design an application that will receive the weight of a parcel and calculate and display the cost per kg and the delivery charge for that parcel.

  Write a function which takes a c string as an input

Write a function which takes a C string as an input and converts it to all uppercase characters. For each lowercase character in the C string, simply subtract 32 from it to form the uppercase character.

  Give five best practices which computer system builders

question 1 provide five best practices that computer system builders should use when determining the file system to use

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd