94%(172)161 out of 172 people found this document helpful
This preview shows page 14 - 19 out of 41 pages.
b. Revise the BMI-determining program to execute continuously until the user enters 0 for the height in inches.:
Programming Logic and Design, 8eSolutions 2-15Pseudocode:startDeclarationsnum heightInchesnum weightPoundsnum heightMetersnum weightKilosnum bminum CENT_IN_INCH = 2.54num CENT_IN_METER = 100num GRAM_IN_POUND = 453.59num GRAM_IN_KILO = 1000string HEIGHT_PROMPT = “Enter the user’s height in inches: ”string WEIGHT_PROMPT = “Enter the user’s weight inpounds: ”string END_LINE = “End of job”
Programming Logic and Design, 8eSolutions 2-16housekeeping()while heightInches <> 0detailLoop()endwhileendOfJob()stophousekeeping()output HEIGHT_PROMPTinput heightInchesreturndetailLoop()output WEIGHT_PROMPTinput weightPoundsheightMeters = heightInches * CENT_IN_INCH / CENT_IN_METERweightKilos = weightPounds * GRAM_IN_POUND / GRAM_IN_KILObmi = weightKilos / (heightMeters * heightMeters)output bmioutput HEIGHT_PROMPTinput heightInchesreturnendOfJob()output END_LINEreturn7.Draw the hierarchy chart and design the logic for a program that calculates service charges for Hazel’s Housecleaning service. The program contains housekeeping,