Ask Computer Engineering Expert

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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92802741

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As