expand icon
book Programming Logic and Design, Introductory 7th Edition by Joyce Farrell cover

Programming Logic and Design, Introductory 7th Edition by Joyce Farrell

Edition 7ISBN: 1285225562
book Programming Logic and Design, Introductory 7th Edition by Joyce Farrell cover

Programming Logic and Design, Introductory 7th Edition by Joyce Farrell

Edition 7ISBN: 1285225562
Exercise 15

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.

Step-by-step solution
Verified
like image
like image

Step 1 of 4

Hierarchy chart of program that computes the cost of travelling:

    <div class=answer> Hierarchy chart of program that computes the cost of travelling:


Step 2 of 4


Step 3 of 4


Step 4 of 4

close menu
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
cross icon