You are on page 1of 1

TBB2073 Structured Programming & Database

LAB 2 WEEK 3
Objective 1. To design algorithms using flowchart and pseudocode.

Deliverables: Flowchart and pseudocode.

Activity #1 A program is required to read from screen the length and width of a rectangular house block and the length and width of the rectangular house that has been built on the block. The program should then compute and display the mowing time required to cut the grass around the house at the rate of two square meters per minute. 1. Determine the input(s) and output(s) of the program. 2. Write the pseudocode for the program. 3. Desk check with one set of test data. Activity #2 National Energy Berhad (NEB) is a domestic company that supplies electricity to various types of consumers such as residential, industrial, commercial and transportation. NEB records its customers electricity usage figures on a customer usage file. Each record on the file contains the customer id, name/owner, address and their electricity usage expressed in unit for each kilowatts/hour used. For the residential type of customer, the company bills its customer according to the following rate : if the customers usage is 200 units or less, a rate of 21.8 cent per unit is applied; if the customers usage is more than 200 units, then a rate of 25.8 cent per unit is applied for the first 800 units and 27.8 cent per unit for the remaining usage. Design a program for this company that will read the customer usage file, calculate the amount owing for electricity usage for each customer and print a report listing each customers id, name/owner, address, their electricity usage and the amount owing. At the end of the report, print the total number of customers and the total amount owing to the company. Use flowchart to design your proposed algorithm.

You might also like