Вы находитесь на странице: 1из 3

Homework

Chapter 2, p. 88, Logic Exercise #5-a


Required: Data Dictionary, Hierarchy Chart, Flowchart, and Pseudocode for the Couch Potato
Furniture Company:
1. Hierarchy chart:

Main Program
housekeeping () detail () endOfJob ()


















2. Flowchart:



start
Declarations
num wholesalePrice
num retailPrice
num profit
string WHOLE_PROMPT = Enter the wholesale price
string RETAIL_PROMPT = Enter the retail price
string END_LINE = Thanks for using this program
housekeeping ()
detail ()
endOfJob ()
stop
housekeeping ()
output
WHOLE_PROMPT
input wholesalePrice
return
endOfJob ()
output END_LINE
return
detail ()
output
RETAIL_PROMPT
Input retailPrice
profit = retailPrice - wholesalePrice
output profit
return














3. Pseudocodes:



start
Declarations
num wholesalePrice
num retailPrice
num profit
string WHOLE_PROMPT = Enter the wholesale price
string RETAIL_PROMPT = Enter the retail price
string END_LINE = Thanks for using this program
housekeeping ()
details ()
endOfJob ()
stop

housekeeping ()
output WHOLE_PROMPT
input wholesalePrice
return

detail ()
output RETAIL_PROMPT
input retailPrice
profit = retailPrice wholesalePrice
output profit
return

endOfJob ()
output END_LINE
return

Вам также может понравиться