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, 8eSolutions 2-2810. 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, 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, 8e11. 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, 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: ”