a. You created a Rental class for Sammys Seashore Supplies. Now extend the class to create a

Question:

a. You created a Rental class for Sammy’s Seashore Supplies. Now extend the class to create a LessonWithRental class. In the extended class, include a new Boolean field that indicates whether a lesson is required or optional for the type of equipment rented. Also include a final array that contains Strings representing the names of the instructors for each of the eight equipment types, and store names that you choose in the array. Create a LessonWithRental constructor that requires arguments for an event number, minutes for the rental, and an integer equipment type. Pass the first two parameters to the Rental constructor, and assign the last parameter to the equipment type. For the first two equipment types (personal watercraft and pontoon boat), set the Boolean lesson required field to true; otherwise, set it to false. Also include a getInstructor() method that builds and returns a String including the String for the equipment type, a message that indicates whether a lesson is required, and the instructor’s name. Save the file as LessonWithRental.java.
b. You created a RentalDemo program for Sammy’s Seashore Supplies. The program uses an array of Rental objects and allows the user to sort Rentals in ascending order by contract number, equipment type, or price. Now modify the program to use an array of four LessonWithRental objects. Prompt the user for all values for each object, and then allow the user to continuously sort the LessonWithRental descriptions by contract number, equipment type, or price. Save the file as LessonWithRentalDemo.java.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Programming

ISBN: 978-1337397070

9th edition

Authors: Joyce Farrell

Question Posted: