You are on page 1of 2

COURSE TITLE

Program Logic Formulation

COURSE CODE

ICT1101

LAB WORK NO

LEARNING OBJECTIVES
Introduce to students Decision Logic Structure.
LEARNING OUTCOME
Students should able to prepare the tools: PAC, Structure Chart, IPO Chart, algorithm and
flowchart for single IF-THEN and IF-THEN-ELSE instruction.
You should present your solution in PAC, Structure Chart, IPO Chart, algorithm, flowchart, data
dictionary and C++ coding for the following exercises.

DESCRIPTION OF THE LAB SESSION


Tutorial 1
This program accepts two integers from the keyboard. The program should decide which one is a
larger number, and print the larger number. This program must only use single-selection form of
if statement.
Save it as Week6Tutorial_1.cpp
Tutorial 2
Referring from the diagram below. Change the 1st Tutorial to apply if-else statement.

Save it as Week6Tutorial_1.cpp
Exercise 1
Design a program that will advise the society based on Air Pollution Index (API) reading. This
program should accept the reading from the user. Then it will indicate the user; the current
reading from their input.
(i)

The condition of API should be as follow:

API reading

Indication

API < 50

Good. Low pollution without any


bad effect on health.

(API reading is below 50)


API > 51
API < 100
(API reading is between 51-100)
API > 101
API < 200
(API reading is between 101-200)
API > 201
API < 300
(API reading is between 201-300)
API > 300

Moderate. Pollution that does not


pose any bad effect on health
Unhealthy. Worsen the health
condition of high risk people who is
the people with heart and lung
problem
Very unhealthy. Worsen the health
condition. Dangerous for people
with heart and lung complication.
Hazardous. Stay in house people.
Its toxic. We want fresh air!!

(API more than 300)


Present your solution in (with MS Word save as Pollution.docx and CPP file as Week6Ex1.cpp):
a) PAC
b) Structure Chart
c) IPO chart
d) Algorithm
e) Flowchart
f) Data dictionary.
Deadline: Submit your work on Wednesday 30th September 2015 by 17:00:00 GMT +8

You might also like