I already did the question but I just want to double check it with someone\'s to
ID: 672365 • Letter: I
Question
I already did the question but I just want to double check it with someone's to make sure I did it correctly.
Draw the hierarchy chart and then plan the logic for a program needed by the sales manager of The Henry Used Car Dealership. The program will determine the profit on any car sold. Input includes the sale price and actual purchase price for a car. The output is the profit, which is the sale price minus the purchase price. Use three modules. The main program declares global variables and calls housekeeping, detail, and end-of-job modules. The housekeeping module prompts for and accepts a sale price. The detail module prompts for and accepts the purchase price, computes the profit, and displays the result. The end-ofjob module displays the message Thanks for using this program.
Explanation / Answer
Sample:
MAIN PROGRAM
Start
Declarations
GLOBAL num SalePrice
GLOBAL num PurchasePrice
GLOBAL num Profit -->> added variable for profit
-->> calling all your modules to do each specific job.
CALL Housekeeping
CALL Detail (SalePrice) -->> THis means SalePrice is needed so that this can be executed properly
CALL End-Of-Job
End
--------------------------------------
HouseKeeping Module
Start
DISPLAY "Input Sale Price:" -->>> you can also use PROMPT
ACCEPT SalePrice
End
--------------------------------------
Detail Module (SalePrice) -->> THis means SalePrice is needed so that this can be executed
Start
DISPLAY "Input Purchase Price:" -->>> you can also use PROMPT
ACCEPT PurchasePrice
Profit = SalePrice - PurchasePrice
Print "The Profit is: " Profit
End
--------------------------------------
End-Of-Job Module
Start
Print "Thanks for using this program."
End
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.