Lab 02 Goals: * To practice creating java instances and calling methods * To call methods with parameters * To learn about primitive types * To understand the difference between parameters, private fields and local objects * To understand the role of constructor, mutators and accessors * To write fundamental Java instructions: assignment, println, if * To write arithmetic expressions in Java * Extra credit: To develop your first Java class and project from scratch! 0. Complete all the Chapter One exercises. 1. Complete the exercises at the beginning of Chapter Two: 2.1-2.42 2. Extra credit if completed this week (it will be required next week!) Complete all the Chapter Two exercises. The Challenge Exercises are extra credit (make sure to explicitly tell the professor that you wish to have them graded, or the random lab grading policy may miss your extra credit!). Some of the exercises, such as 2.9, are not about writing or executing a Java program. Instead, they ask a question. The "answer" to these exercises should be typed or neatly handwritten in your Lab Log Book (LLB). This LLB can be a simple text document prepared on your favorite word processor. Make sure you print your updated LLB after every lab and bring it to class, in case the professor gives a open-notes quiz! 3. Extra credit if completed this week (it will be required next week!) Implement a class Car that provides a programmatic model for a car object with the following functionality: * Ability to construct a Car object by specifying its gas tank capacity, its gas mileage (the number of miles it will travel on one gallon of gas), and the number of gallons of gas (currently) in its tank. * Ability to find out the number of gallons in the tank of a Car object. * Ability to find out the capacity of a Car object's tank. * Ability to find out the mileage of a Car object. * Ability to print on the screen a Car object's tank capacity, mileage and current number of gallons of gas in tank. * Ability to find out how many miles the car can travel with its current gas. * Ability to "fill" gas into a Car object. We should be able to specify the number of gallons that we are filling. If the Car object's tank cannot accpet this number of gallons, then the Car object should remain unchanged and an appropriate error message should appear on the screen. * Ability to "drive" a Car object for a specified number of miles. If the object is not able to drive the given number of miles (because it would run out of gas, for example), then the Car object should remain unchanged and an appropriate error message should appear on the screen. All private attributes and methods of the class Car must be documented.