0% found this document useful (0 votes)
16 views6 pages

Problem Analysis for CD Pricing

The document provides information about analyzing discounts on CD purchases. It includes a problem analysis chart, IPO chart, flow chart, interactivity chart, coupling diagram, and data dictionary that describe the input, processing, and output for a program to calculate the total price, savings from a discount, and final price after applying the discount. The program prompts the user to enter the number of CDs purchased and uses different discount rates depending on the amount purchased to calculate the results.

Uploaded by

嘉群
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views6 pages

Problem Analysis for CD Pricing

The document provides information about analyzing discounts on CD purchases. It includes a problem analysis chart, IPO chart, flow chart, interactivity chart, coupling diagram, and data dictionary that describe the input, processing, and output for a program to calculate the total price, savings from a discount, and final price after applying the discount. The program prompts the user to enter the number of CDs purchased and uses different discount rates depending on the amount purchased to calculate the results.

Uploaded by

嘉群
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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

You might also like