header

Homework 2

Write a Java class named "Car" that models an automobile. The class should include the following instance variables (all String objects):

The intent for the cylinder field is to store the number of cylinders as a numeral (the string representation of a number). For example, if the car has four cylinders, we would enter the number of cylinders as the numeral "4" rather than the as the word "four". (Either representation would be appropriate; we just choose to use the numeral rather than the word.)

Your class should include the following methods:

Your class file should include appropriate documentation comments for the class as a whole and for each method.

Submitting Your Work

The project folder should be named "Hmwk02". When you create the Car class, be sure to select the "Class" type rather than the "BlankApplication" type. Send me your Car.java file as an attachment to an email message whose subject is "Hmwk02".