# Programming logic and design 8e solutions 2 28 10

• Homework Help
• 41
• 93% (177) 165 out of 177 people found this document helpful

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 28 - 33 out of 41 pages.

Programming Logic and Design, 8eSolutions 2-2810. Draw the hierarchy chart and design the logic for a program for the River FallsHomes Construction Company. Design a program that prompts the user for a lotnumber in the River Falls subdivision, and data about the home to be built thereincluding number of bedrooms, number of bathrooms, and size of garage in numberof cars it holds. Output is the price of the home which is \$50,000 base price plus\$17,000 for each bedroom, \$12,500 for each bathroom,, and \$6,000 for each car thegarage holds. The program accepts lot number continuously until 0 is entered. Usenamed constants where appropriate. Also use appropriate modules, including one thatdisplaysEnd of jobafter the sentinel is entered for the lot number.
##### We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
Chapter 1 / Exercise 2
JavaScript: The Web Warrior Series
Vodnik
Expert Verified
Programming Logic and Design, 8eSolutions 2-29Pseudocode:startDeclarationsnum pricenum lotNumbernum numBedsnum numBathsnum garageSizenum BASE_PRICE = 50000num BED_PRICE = 17000num BATH_PRICE = 12500num GARAGE_PRICE = 6000string LOT_PROMPT = “Enter the lot number: ”string BEDS_PROMPT = “Enter the number of bedrooms: ”string BATHS_PROMPT = “Enter the number of bathrooms: ”string GARAGE_PROMPT = “Enter the garage size (cars): ”string END_LINE = “End of job”
Programming Logic and Design, 8eSolutions 2-30housekeeping()while lotNumber <> 0detailLoop()endwhileendOfJob()stophousekeeping()output LOT_PROMPTinput lotNumberreturndetailLoop()output BEDS_PROMPTinput numBedsoutput BATHS_PROMPTinput numBathsoutput GARAGE_PROMPTinput garageSizeprice = BASE_PRICE + (BEDS_PRICE * numBeds)+(BATHS_PRICE * numBaths) + (GARAGE_PRICE * garageSize)output priceoutput LOT_PROMPTinput lotNumberreturnendOfJob()output END_LINEreturn11. Draw the hierarchy chart and design the logic for a program for Arnie’s Appliances.Design a program that prompts the user for a refrigerator model name, and theinterior height, width, and depth in inches. Calculate the refrigerator capacity in cubicfeet by first multiplying the height, width and depth to get cubic inches, and thendividing by 1728 because there are 1728 cubic inches in a cubic foot. The programaccepts model names continuously until “XXX” is entered. Use named constantswhere appropriate. Also use modules, including one that displaysEnd of jobafter thesentinel is entered for the model name.
Programming Logic and Design, 8eSolutions 2-31Flowchart:Pseudocode:startDeclarationsstring modelNumbernum heightnum widthnum depthnum capacitynum CUBIC_INCHES = 1728string MODEL_PROMPT = “Enter the model number: ”string HEIGHT_PROMPT = “Enter the interior height: ”string WIDTH_PROMPT = “Enter the interior width: ”
Programming Logic and Design, 8eSolutions 2-32string DEPTH_PROMPT = “Enter the interior depth: ”string END_LINE = “End of job”housekeeping()while modelNumber <> “XXX”detailLoop()endwhileendOfJob()stophousekeeping()output MODEL_PROMPTinput modelNumberreturn

Course Hero member to access this document

Course Hero member to access this document

End of preview. Want to read all 41 pages?

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
NUM, hierarchy chart
##### We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
The document you are viewing contains questions related to this textbook.
Chapter 1 / Exercise 2
JavaScript: The Web Warrior Series
Vodnik
Expert Verified