This problem set covers Chapter 5.

Item Sales (5 points)

(Exercises #6, Page 358) Consider a class that keeps track of the sales of an item. An object of this class will have the attributes:

And the following methods:

Implement the class in Java and write some Java code to test the class.

Name these programs ItemSales & ItemSalesDemo

Motor Boat (5 points)

(Exercises #7, Page 359) Consider the class MotorBoat that represents motorboarts. A motorboat has attributes for:

The class has the following methods:

If the boat has efficiency e, the amount of fuel used when traveling at a speed s for time t is (e * (s^2) * t). The distance traveled in that time is (s * t).

Implement the class in Java and write some Java code to test the class.

Name these programs MotorBoat & MotorBoatDemo