CS1150 (Fall 2012, Section 4): Programming Assignment 6

Classes and Methods


  1. Create a java class called Car. Implement a main method inside this class. This method will only be used for your own testing; I will use my own main method when I grade your programs.
  2. A car has an odometer (double), an amount of fuel in its gas tank (double; number of gallons), an average miles-per-gallon (double), a mileage at which the oil was last changed (double), and a serial number (int). Declare member variables for these and implement the following accessors and mutators (Note: Do not implement a mutator if a mutator is not listed. This will likely cause your class not to work with my test program.):
  3. Implement methods with the following behaviors:


Submit as per the syllabus.