The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 4 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
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.
-----------