Problem Analysis Chart
Given Data Required Results
Amount purchased Cd normal price
Discount%
Saved
Price after discount
Required Processing
Total price = cd price * amount purchased
Total saved = total price * (discount/100)
Price after discount = total price - saved
Solution Alternative
1. Define the cd price as RM15
IPO Chart
Input Processing Module Reference Output
Amount of cd
purchased
1. Enter amount of cd
purchased.
2. Define the discount rate
10%, 20%, 30%.
3. Calculate total price of cd
purchased.
4. Calculate total saved.
5. Calculate price after
discount.
6. Print Cd normal price
Discount%, Saved, Price after
discount
Input
Checkd
Calc
Calc
Calc
display
Cd normal price
Discount%
Saved
Price after discount
Flow chart
Start
input
calc
display
end
input
Prompt
user to
enter cd
purchased
Total price = cd price
* amount purchased
Total saved = total
price*(discount/100)
Price after discount
= total price - saved
return
return
display
Display Cd
normal
price
Display
Discount%
Display
Saved
Check d
calc
return
Display
Price after
discount
checkd
Amount>9
Discount 30%
Amount>6
Amount>2
Discount 0%
Discount 20%
Discount 10%
return
Interactivity chart
Coupling Diagram
Data Dictionary
Item Variable
Name
Data Type Module(s) Scope
Amount purchased amt Numeric-integer Input/checkd/calc global
Total price totalprice Numeric-integer Calc/display global
CD price cdprice constant calc global
Money saved saved Numeric-real calc/display global
Discount discount Numeric-real Checkd local
Discount discount1 Numeric-real main/calc/display local
Price after discount finalans Numeric-real Main/display local
Price after discount finalans1 Numeric-real main/calc local
Main
input checkd display
Main
input checkd display
Calc
calc