A slip class file with indicated methods defined

Assignment Help Programming Languages
Reference no: EM13192054

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 IDs; just demonstrate this function once in your program; i.e. only ask for one slip ID, then continue on in the program.)

? (If they enter an invalid slip ID, inform them of such.)

? (No need to prompt the user for more slip IDs; just demonstrate this function once in your program; i.e. only ask for one slip ID, then continue on in the program.)

? No need to do advanced error checking; for this exercise we will assume that if the customer exists, then the slip and boat numbers also exist, even though in real life this might cause our program to encounter errors.

Unit 4 Programming Notes:

1. Because you are using the same Classes you created in Unit 3 (and will be instantiating your objects with data you have already created), you should copy your Visual Studio solution to create your Unit 4 Project. You can then add Methods to your Class files for Unit 4. (As in Unit 3, even though you will be submitting four separate .cs files, it is suggested that you create them all as one Visual Studio Project, if that is what you are using for your C# programming.)

2. For sorting "objects" by ID, you need to create an Interface using the iComparable.CompareTo() method in the Class file as explained on page 286 ff. (This same process could be used to sort by name or by any other field.)

3. In order to access elements of an object individually, you will need to assign "getters" and "setters", and set their protection levels properly. Consider using the auto-implemented property as explained on pp. 256-259.

Unit 4 Deliverables:

  • A customer Class file with indicated Methods defined.
  • A boat Class file with indicated Methods defined.
  • A slip Class file with indicated Methods defined.
  • A main C# test program that carries out the processes indicated above.

Reference no: EM13192054

Questions Cloud

By what percent did gdp decline : According to the News on page 159, (a) By what percent did GDP decline (b) How much output was lost in the $14 trillion economy (c) How much income did this represent for each of the 300 million U.S. citizens
Define energy consumption quantity represent : The use of the British thermal unit (Btu) is common in much enginerring work. (1Btu=1054J). A Btu is the amount of heat required to raise the temperature of 1Ib of water by 1 degree F. How many QUADS of energy does world energy consumption quantit..
Construct the relative frequency distribution of median : The cross-tabulation below classifies US states by median household income and by household Gini coefficient (a measure of income inequality). Use the cross-tabulation to answer the questions that follow.
Information and data : Suppose that your firm was considering building a new theater or attraction in Branson, Missouri. Where would you seek information and data? What kind of data would be needed?
A slip class file with indicated methods defined : A customer Class file with indicated Methods defined - A boat Class file with indicated Methods defined and a slip Class file with indicated Methods defined.
Group promoted aristocratic pretensions : Jefferson believed that this group promoted aristocratic pretensions and courtly intrigue through such practices as weekly levees or formal receptions for presidential guests.
Define what was the initial concentration of hcl : The flask shown here contains 10.0 mL of HCl and a few drops of phenolphthalein indicator. The buret contains 0.300 M NaOH. B. What was the initial concentration of HCl?
What is the implied price elasticity of demand : "When the British government tripled university fees for foreign students in Great Britain, about one-half of them left to study in other countries." What is the implied price elasticity of demand by foreigners for a British education is (in absolute..
Idea of uniformitarianism : Which one of the following observations and inferences is consistent with the idea of uniformitarianism?

Reviews

Write a Review

Programming Languages Questions & Answers

  Program to give and take advice on program writing

Write down the program which gives and takes advice on program writing. Program starts by writing the piece of advice to screen and asking user to type in different advice.

  Write application that inputs five number

Use a one-dimensional array to solve the following problem: Write an application that inputs five numbers, each of which is between 10 and 100, inclusive.

  Write program to show percentage of calories come from fat

Write a program which asks user to enter number of calories and fat grams in a food item. The program must display percentage of the calories that come from fat.

  Code to sum of all the elements of the array

Write some code that places the sum of all the elements of the array x into total. Declare any variables that you need.

  Write program to read series of pairs of numbers

Write the program which reads series of pairs of numbers (product code and quantity sold) then the program must compute and print the total retail value

  Explain some ways tables can be used on web page

Tables are one of the most useful page layout tools available to web designers. Explain some ways tables can be used on a web page. Elaborate on other ways to achieve the same look.

  Program to display number of times name appears in file

You have read all names from the file, display number of times this name appears in file. write logic - step by step - to show code program to accomplish this task.

  Explain fundamentals types of scalar-array and hash in perl

Later versions of perl moved beyond fundamentals types of scalar, array, and hash and introduced a reference type. Write down the Perl subroutine, referenceTypeExample.

  Program display meal cost and tax amount

The program should then display the meal cost,taxAmt, and total bill respectively and use named constants Tax and tip to initialize the tax and the tip values.

  Write multiplication program make positive one-digit integer

Write down program which will aid the elementary school learn multiplication. Use Random object to make two positive one-digit integers.

  Create constructor by allotting value to gpa attribute

We have provided the super call, which does some of the work of constructor. Your code must complete constructor by allotting value of g to gpa attribute.

  Create user friendly application-display name-button clicked

Create a user friendly application which can do the following: displays the name and address when button is clicked and permit user to choose a state, and when a user clicks a button.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd