miles-per-gallon

There are 1 repository under miles-per-gallon topic.

  • MilesPerGallonRevisitedbell-kevin / MilesPerGallonRevisited

    Chapter 15 Example Project: Miles Per Gallon Revisited. In Ch 7 in the previous course, you created a project for calculating miles per gallon for a single trip and for cumulative trips. In this project, you will use the same class named MPG. It has instance variables for miles and gallons for a trip, total miles and total gallons for the cumulative calculation, and methods to instantiate a trip, display current MPG, and display total MPG. (Hint: after creating a new project here, create the new class, and copy all of the code from the Ch 7 MPG class into the Ch 15 MPG class.)

    Language:Java Stargazers:
  • MPGCalculatorProjectbell-kevin / MPGCalculatorProject

    SDEV 1060 Project. This project calculates miles per gallon (MPG) for a single trip, and for all trips entered. There is a class for MPG for a single trip, with instance variables for miles, gallons, and MPG for that trip. In addition, there are class (static) variables for total miles, total gallons, total MPG, and number of trips. In the main class, several trips are created and the values are displayed. At the end, the total MPG (total miles / total gallons) is displayed.

    Language:Java Stargazers: