Chapter 2 Exercises - 5. a) Hierarchy Chart main program...

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

The preview shows page 1 - 3 out of 6 pages.
main programhousekeeping()detail()endOfJob()5.a)Hierarchy ChartPseudocodestartDeclarationsnum profit;num salePrice;num purchasePrice;string SALE_PROMPT = “Enter the sale price: “;string PURCHASE_PROMPT = “Enter the purchase price: “;string END_LINE = “Thanks for using this program”;housekeeping();detail();endOfJob();stophousekeeping();output SALE_PROMPT;input salePrice;returndetail();output PURCHASE_PROMPT;input purchasePrice;profit = salePrice - purchasePrice;output profit;returnendOfJob();output END_LINE;return
main programhousekeeping()detailLoop()endOfJob()b)Hierarchy ChartPseudocodestartDeclarationsnum profit;num salePrice;num purchasePrice;string SALE_PROMPT = “Enter the sale price: “;string PURCHASE_PROMPT = “Enter the purchase price: “;string END_LINE = “Thanks for using this program”;housekeeping();while salePrice <> 0detailLoop()endwhileendOfJob();stophousekeeping();output SALE_PROMPT;input salePrice;returndetailLoop();output PURCHASE_PROMPT;input purchasePrice;

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 6 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
NUM, hierarchy chart, endOfJob

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture