Lab 03 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-else * To write arithmetic expressions in Java * Extra credit: To develop your first Java class and project from scratch! 1. Complete exercises 2.1-2.42 as you read through Chapter Two. 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). Please focus on coming up with the correct answer, instead of formatting the LLB beautifully or writing long answers (a single bullet or number suffices as an answer to some questions!). You may want to bring yoru LLB to class, in case the professor gives a open-notes quiz! 2. (You may work with a lab partner for this exercise. If you work in pairs, you must take turns at the keyboard, and be prepared to demo your project to Dr. Lobo and answer her oral questions.) 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. A test class that throughly tests each method of the Car class is required. 3. Extra credit if completed this week (it will be required next week!) Complete all Chapter Two exercises.