Answered You can hire a professional tutor to get the answer.

QUESTION

Ok I am having problems with this question. Draw the hierarchy chart and design the logic for a program that calculates the projected cost of an...

Ok I am having problems with this question.

Draw the hierarchy chart and design the logic for a program that calculates the projected cost of an automobile trip. Assume that the user’s car travels 20 miles per gallon of gas. Design a program that prompts the user for a number of miles driven and a current cost per gallon. The program computes and displays the cost of the trip as well as the cost if gas prices rise by 10 percent. The program accepts data continuously until 0 is entered for the number of miles. Use appropriate modules, including one that displays End of program when the program is finished.

My problems is that I am stuck on the detailLoop () in the pseudocode and I have...

start

Declarations

string numMilesDriven

num costPerGallon

num tripCost

num newTripCost

num INCREASE = 0.10

num MILES_PER_GALLON = 20

string MILES_PROMPT = “Enter the number of miles driven: ”

string GALLON_PROMPT = “Enter the current cost per gallon: ”

string END_LINE = “End of program”

housekeeping()

while numMilesDriven <> 0

detailLoop()

endwhile

endOfJob()

stop

housekeeping()

output MILES_PROMPT

input numMilesDriven

return

detailLoop() 

Output MILES_PROMPT

input milesDriven 

That is where I get lost at. 

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question