Question: Please write a program that does the following: (1 Point) Provide the following menu (choices) to the user: o Enter trip data o Show Eco

Please write a program that does the following:

(1 Point) Provide the following menu (choices) to the user:

o Enter trip data

o Show Eco Score

o Exit program

Ask the user to choose from the menu

o (2 Points) Continue to show the menu (even with invalid choice give error message

but dont exit) until the user chooses Exit program.

For Enter trip data:

o (1 Point) Ask the user for:

- # miles traveled in the past 5 minutes

- Ask the user for gallons of gas consumed in the past 5 minutes

o (2 Points) Calculate total distance traveled, total gas consumed (gallons), MPG over the past 5 minutes, and cumulative MPG

o Ask the user if the user would like to add more data in 5 minute increments

- (2 Points) Allow the user to keep entering data in 5 minute increments until the user has no more data to enter

o (1 Point) Return to the menu when the user is done entering trip data

For Show Eco Score

o (2 Points) Show total distance traveled, total gas consumed, and cumulative MPG

o (3 Points) Show an appropriate message (you decide the message) for when cumulative MPG is: Over 100, between 50 and 100, between 30 and 50, between 10 and 30, and below 10.

o (1 Point) Return to the menu after displaying message

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!