flowchart exercise - MetaLab

advertisement
SOFTWARE DEVELOPMENT
METHOD
EXERCISE
UNIVERSITI TENAGA NASIONAL
“Generates Professionals”
Exercise 1
Table 1 gives the Air Pollutant Index (API) given by the Department of
Environment to describe the degree of air quality. Create a program that
requests the API readings as input and then display the appropriate
descriptor.
Table 1: Air Pollutant Index
API Reading
Descriptor
0 – 50
Good
51 – 100
Moderate
101 – 200
Unhealthy
201 – 300
Very Unhealthy
> 300
Hazardous
a) Write a problem analysis for the problem above
b) Draw flowchart and pseudocode
UNIVERSITI TENAGA NASIONAL
“Generates Professionals”
Exercise 2
Given charges for customer as following:
 A minimum rate of RM15.00 per month for usage up to 1000 cubic feet.
 RM0.02 per cubic foot for each cubic foot used over 1000 and up to 3000.
 RM0.05 per cubic foot for each cubic foot used over 3000.
You need to solve the problem using SDM approach to develop a program to show
the solution for calculating the gas bill for a customer of Shill Gas Company.
a) Write the Problem Analysis for this situation.
b) Draw the flow chart and pseudocode for the program.
UNIVERSITI TENAGA NASIONAL
“Generates Professionals”
Download