Unit 4 – Creating Methods
Since you have created the data objects for Harbor View Mooring, you now need to create processes associated with each object. In order to keep with good object-oriented practices of implementation hiding and program modularization, all processes related to an object (class) must be kept in a discreet method, within the object’s Class definition file. So, your job is to create Methods that accomplish the following tasks.
Assumption: Each customer will only be owner of one boat and will only rent one slip.
You are expected to follow the “General Directions” found in the “Course Project Instructions” link on our course page.
Customer Class:
(1) Use the Customer class and array you created in Unit 3. (See Note #1 in Programming Notes below.)
(2) Create a Method in the Customer Class file that will sort the Customers by ID number when called from the main program. To do this, you will need to use an Interface (using the iComparable method) as described in the programming notes below. (See Note #2 in Programming Notes below.)
Boat Class:
(1) Use the Boat class and array you created in Unit 3.
(2) Each year, a customer must pay an insurance premium to HVM based on a fixed amount (determined by HVM) and the value of their boat. Create a Method in the Boat Class file called, “BoatInsurance”. This Method will receive a fixed amount and a percentage (floating point number) as parameters (input by the user) and will return the insurance premium due from the owner of this boat. (The insurance premium is the fixed amount plus the percentage of the boat’s value; the fixed amount and percentage are both supplied by the user.) In keeping with the OO principles of Abstraction and Reusability, this Method will be in the Boat Class file.
Slip Class:
(1) Use the Slip class and array you created in Unit 3.
For Unit 4, the following tasks need to be demonstrated using the Methods you have created:
Use the Interface you created in the Customer class to sort the customers by ID number.
Print Customer information about each customer in sorted order. You can either print all information (fields), or print customer ID, last name, first name, boat number, and slip number (excluding address and phone number).
Continuously prompt the user for a customer number; while user enters a valid customer number, present customer name, boat ID, and slip ID. Tell the user if they enter an invalid customer ID. Continue prompting the user until they indicate they are finished.
Prompt the user for a boat ID;
if the boat ID is valid, return the value of the boat (using “getter” Methods from the Boat class). (See Note #3 in Programming Notes below.) and
ask the user if they want to calculate the yearly boat insurance premium;
if they do, prompt them for a fixed amount and a percentage, and then return the insurance premium amount. (For this task you should use the BoatInsurance method from the Boat class.)
Print out the insurance premium amount.
(If they enter an invalid boat ID, inform them of such.)
(No need to prompt the user for more boat IDs; just demonstrate this function once in your program; i.e. only ask for one boat ID, then continue on in the program.)
Prompt the user for a slip ID; if the slip ID exists, return the slip’s monthly rental amount,
and tell whether the slip is rented or not (using “getter” Methods from the Slip class). (See Note #3 in Programming Notes below.)
Ask the user if they want to change the monthly slip rental amount; if they do, then prompt them for the amount and update the slip rental amount (using “setter” Methods from the Slip class).
Print all the new slip information (at least slip ID and rental amount) to verify to the user that the slip rental amount was updated. (No need to prompt the user for more slip IDdiscrete optimization,Engineering,$20.00,
Get a Unique Answer HERE or Order a Similar Paper
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Place Order” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.