Title: Major Assignment: Assessment Summary
Title: Major Assignment: Assessment Summary
Pair:☒ Individual:☐
Title: Major Assignment
Graded out of: 50 Weight: 25%
1
Question 1 [5 marks]
Draw an IPO Chart aka defining diagram for the following problem statement (5 marks).
Hint: You only need to determine what is to be done in the program, not how it is done i.e. you are not asked to
write an algorithm here.
A program that receives three temperature readings on a particular day, one in the morning, one in the
afternoon and one at night. It accepts those readings as integers only, and calculates and displays to the
screen the average temperature, calculated by
It also determines and displays the maximum and minimum of the three temperatures of the day. If a non-
integer is read, your program will display an error message and prompt the user again for a temperature
reading.
Develop an algorithm for a program that reads from a data file, employee.txt, employee records: the
employee number, pay rate and the number of hours worked in a week. The first integer read from the
first row of the file indicates the number of employee records stored in the file. Every employee record is
made up of a pay rate and the hours worked. Your program will continue reading and validating each
employee record. And, if valid, it will compute and print to the screen the employee’s weekly pay. It will
continue to read, validate and process all the employee records.
According to the company’s rules, the maximum hours an employee can work per week is 50 hours, and
the maximum hourly rate is AUD25.00 per hour. If the hours worked or the hourly rate is out of range,
your program prints an error message: Error: hours worked out of range, or Error: hourly rate out of
range.
Weekly pay is calculated as [hours worked] times [pay rate]. If more than 35 hours are worked, payment
for the overtime hours worked is calculated at time-and-three-quarters.
Steps to undertake:
1. Start by creating a defining diagram of the problem. (recommended for planning)
2. Then, expound on your solution algorithm in pseudocode.
3. The final form must be modularised. (required for submission)
2
Question 4 (20 Marks)
Develop an algorithm for the following problem statement. Your solution should be a modularised
pseudocode with relevant and meaningful comments and a hierarchy chart. You should provide appropriate
error messages
A domestic gas supply company, Energy Australia Ltd., records its customers’ gas usage figures on a
customer usage file. Each record in the file contains the customer’s number, name, address, and gas usage
expressed in cubic metres.
Design a solution algorithm that will read the customer gas usage data, calculate the amount owing for gas
usage for each customer, and then print a report listing each customer’s number, name, address, gas usage
and the amount owing. At the end of completing a customer usage report, it prompts the user if s/he
wants to continue. If s/he enters ‘yes’, your program will continue from the outset and accept another
customer’s gas usage data. If s/he enters ‘no’, your program terminates.
The company bills its customers according to the following rate: if the customer’s usage is 68 cubic metres
or less, a rate of AUD2.10 per cubic metre is applied; if the customer’s usage is more than 68 cubic metres,
then a rate of AUD1.73 per cubic metre is applied for the first 68 cubic metres and AUD1.53 per cubic
metre for the remaining usage.
At the end of the report, print the total number of customers and the total amount owing to the company
by the customers.
Steps to undertake:
1. You must first create a defining diagram for this problem. (recommended for planning your solution)
2. Then, group the activities into modules and construct a hierarchy chart to visualise the modularisation
of your program. (required for submission)
3. Establish the algorithm of the main function, and (required for submission)
4. Develop the algorithm for each successive module outlined in your hierarchy chart. (required for
submission)