Programming Logic and Design 8e Solutions 2 28 10 Draw the hierarchy chart and

# Programming logic and design 8e solutions 2 28 10

• Homework Help
• 41
• 94% (172) 161 out of 172 people found this document helpful

This preview shows page 28 - 33 out of 41 pages.

Programming Logic and Design, 8e Solutions 2-28 10. Draw the hierarchy chart and design the logic for a program for the River Falls Homes Construction Company. Design a program that prompts the user for a lot number in the River Falls subdivision, and data about the home to be built there including number of bedrooms, number of bathrooms, and size of garage in number of 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 the garage holds. The program accepts lot number continuously until 0 is entered. Use named constants where appropriate. Also use appropriate modules, including one that displays End of jobafter the sentinel is entered for the lot number.
Programming Logic and Design, 8e Solutions 2-29 Pseudocode: start Declarations num price num lotNumber num numBeds num numBaths num garageSize num BASE_PRICE = 50000 num BED_PRICE = 17000 num BATH_PRICE = 12500 num GARAGE_PRICE = 6000 string 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, 8e 11. 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 the interior 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 then dividing by 1728 because there are 1728 cubic inches in a cubic foot. The program accepts model names continuously until “XXX” is entered. Use named constants where appropriate. Also use modules, including one that displays End of jobafter the sentinel is entered for the model name.
Programming Logic and Design, 8e Solutions 2-31 Flowchart: Pseudocode: start Declarations string modelNumber num height num width num depth num capacity num CUBIC_INCHES = 1728 string MODEL_PROMPT = “Enter the model number: ” string HEIGHT_PROMPT = “Enter the interior height: ” string WIDTH_PROMPT = “Enter the interior width: ”
Programming Logic and Design, 8e