Show total distance traveled and total gas consumed

Assignment Help Computer Engineering
Reference no: EM132101188

Please write a program that does the following:

• 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 Continue to show the menu (even with invalid choice - give error message

but don't exit) until the user chooses "Exit program."

• For "Enter trip data":

o 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 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

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

o Return to the menu when the user is done entering trip data

• For "Show Eco Score"

o Show total distance traveled, total gas consumed, and cumulative MPG

o 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 Return to the menu after displaying message

Reference no: EM132101188

Questions Cloud

Create an array that holds random integers : Create an array that holds 1000 random integers between 1-1000. Please write a short paragraph, bullet points.
Prove the logical equivalence of conditional statement : Prove the logical equivalence of conditional statement and contrapositive of two propositional variables using truth table.
Define and integer variable named employeescount : Defines a structure called Employee that contains a character member called id that can hold an id that is up to 9 characters long and a float member.
Create a class with the name student : Create a constructor that initializes all int to 0, float to 0.0, char to ' ', name = "NoName".
Show total distance traveled and total gas consumed : Allow the user to keep entering data in 5 minute increments until the user has no more data to enter. Show total distance traveled, total gas consumed.
Create a class line which consists of start -end coordinates : Create a class Line which consists of start and end coordinates, and line type.The default value for line type should be vertical.
Write a mips program that will read in a base : Write a MIPS program that will read in a base (as an integer) and a value (nonnegative integer but as an ASCII string) in that base.
Give the state of the array after it is max heapified : Give the state of the array after 3 "removes" (we are not really deleting anything) have been performed from the heap in phase 2 of heapsort.
Write a program to ask for the chord : With one cut across the middle of a pizza you can cut off half, that is, 50% of the pizza. With one cut at a different place you can cut off.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Illustrate the system processed from the viewpoint

Illustrate the system processed from the viewpoint

  Write a function of f - flop balance

Write a function f - FlopBalance(n,p) that returns a p-vector I with the property that II-' is the number of flops that Procuz) must perform in shared.

  Discuss how forensic investigators can find evidence

Discuss how forensic investigators can find evidence on acquired computers

  Define word and long word memories

Define word and long word memories in the MC68000 to include the hard alignment constraints by modifying the RTN on page 99.

  Determining the missing side of triangle

Write down a program which will figure out the missing side of the right triangle utilizing the Pythagorean Theorem. Suppose that the user entries will make a triangle.

  Discuss use of client-side technologies in your microsite

Your report (Arial - font size 12) should discuss on the following area: Explain the message that you want to be communicated through your microsite. Outline and discuss the use of client-side technologies in your microsite. Discuss how the design of..

  Consider which properties could be verified

define that some properties that can only be validated originally can be approximately transformed to properties that could be verified.

  What are the forbidden lateness and initial collision vector

What are the forbidden lateness and the initial collision vector? Draw the state transition diagram for scheduling the pipeline.

  Create a set of use cases for the picnics r us system

Create a set of use cases for the following system: Picnics R Us (PRU) is a small catering firm with five employees. During a typical summer weekend, PRU caters 15 picnics with 20 to 50 people each.

  Write a program that outputs all stanzas

Write a program that outputs all 99 stanzas of the Ninety-Nine Bottles of Beer on the Wall song. Your program should print the number of bottles in English.

  Analyze the circuit for its operation as an sr flip-flop

Replace the NOR gates in Figure with NAND gates and analyze the circuit for its operation as an SR flip-flop.

  Calculate the equilibrium temperature of the glass bulb

An incandescent light bulb is an inexpensive but highly inefficient device that converts electrical energy into light.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd