homework_assignment2_v2.docx - Chpt.2 Exercise 5 a a Hierarchy chart this is the same for both a and b of this problem Main Program houseKeeping detail

homework_assignment2_v2.docx - Chpt.2 Exercise 5 a a...

This preview shows page 1 - 3 out of 6 pages.

Chpt.2 Exercise 5 a a) Hierarchy chart : this is the same for both a) and b) of this problem b) logic design - Pseudocode start Declarations num actualPrice num salePrice num profit string PROMPT_ACTUAL_PRICE = “Input the actual price in dollars” string PROMPT_SALEL_PRICE = “Input the sale price in dollars” string END_LINE = “Computations complete, have a good day.” houseKeeping() detail() endOfJob() stop detail() output PROMPT_SALEL_PRICE input salePrice profit = salePrice - actualPrice output profit return houseKeeping() output PROMPT_ACTUAL_PRICE input actualPrice return endOfJob() output END_LINE return Main Program houseKeeping() detail() endOfJob()
Chpt.2 Exercise 5 b a) Hierarchy chart : this is the same for both a) and b) of this problem b) logic design – Pseudocode start Declarations num actualPrice num salePrice num profit string PROMPT_ACTUAL_PRICE = “Input the actual price in dollars” string PROMPT_SALE_PRICE = “Input the sale price in dollars” string END_LINE = “Computations complete, have a good day.” houseKeeping() while not (actualPrice = 0) detail_Loop () endwhile endOfJob() stop detail_Loop() output PROMPT_SALE_PRICE input salePrice profit = salePrice - actualPrice output profit output PROMPT_ACTUAL_PRICE input actualPrice return houseKeeping()

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture