Create a method in the customer class file

Assignment Help DOT NET Programming
Reference no: EM13326165

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.

Reference no: EM13326165

Questions Cloud

What voltage was used to accelerate it : If an electron travels 0.250 m from an electron gun to a TV screen in 32.0 ns, what voltage was used to accelerate it
Estimate the velocity with which would contact the ground : estimate the velocity with which you would contact the ground if you jumped from an airplane at an altitude of 500ft and a) air resistance is negligible, b) air resistance is important, but you forgot your parachute
Determine your average speed for the entire trip : You travel from "point" Columbia to St. Louis in a car moving at a constant speed of 60 km/h. What is your average speed for the entire trip
Consultancy report to anthonys orchard : Review the readings and media for this unit, including the Anthony's Orchard case study media and familiarise yourself with the Anthony's Orchard company and its current situation; this can be done by exploring each of the tabs across the top of th..
Create a method in the customer class file : 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.
How much water do produce for the municipality per day : A municipal water plant has four filters that are each 20 ft long by 15 ft wide by 5 ft deep. The demand for water requires that they only operate, on average, three filters per day at a loading of 3 gallons per min / ft^2.
Design for cubist artwork : The design for Cubist artwork was dramatically different from what came before in painting. Why did the artists involved in creating Cubism choose this radical and innovative approach to their design? What influenced early Cubist artists
Find the amount of stored charge : What voltage must be applied to the 5.00 µF capacitor of a heart defibrillator to store 550 J in it? Find the amount of stored charge
Determine the torque t-shear force v and bending moment : Determine the torque T, shear force V, and bending moment M for the following gage readings: 450, 325, 550, and 675 all in microns for gages A through D, respectively. Gages A on side, B on top, C on back side, D on bottom.

Reviews

Write a Review

DOT NET Programming Questions & Answers

  Create a program that prompts the user for a name

Write a program that prompts the user for a name, Social Security number, hourly pay rate, and number of hours worked. Display the information that was input by the user.

  Describe the characteristics of visual studio 2005

Describe the characteristics of Visual Studio 2005 Visual Studio.Net is a suite of products that includes 4 main languages. Name these languages and outline their use in industries

  Application that includes three arrays

Design an application that includes three arrays of type int. Allow the user to enter values into the first two. Write a method to store the product of the two arrays in the third array

  Convert meters to feet and inches.

1. Write a program that can be used to convert meters to feet and inches. Allow the user to enter a metric meter value in a method .

  Demonstrate academic and professional literacy

Demonstrate academic and professional literacy by collating theoretical and practical course material into a workable application through understanding concepts and their practical application using .NET

  Create account management with java

Create account management with java gui using a MVC model.create withdraw, create account, deposit , trasfer ,balance , on the main fram. and On pressing one of these buttons a window "Start deposit/withdraw for ac count: account ID suppose to sho..

  Name some form controls used with dotnet

Managing validation becomes a rather onerous task when you have to design a contact form, an event registration form, a sign in form, etc. What are some form controls used with .NET? Explain your answer.

  Design and use computer package incorporating the techniques

Java source files for your controller. Note that your controller must use fuzzy rules to earn these marks, and it must be different from the example FuzzyController.

  Create an application that displays total no of customers

Joe also performs other nonroutine services and charges for parts and labor ($20 per hour). Create an application that displays the total for a customer's visit to Joe's.

  Program to inputs radius of circle and outputs its area

Write down C# program which inputs radius of a circle and outputs its area. Permit the user to repeat computations as often as desired.

  What is a connectionstring

What is a ConnectionString. Give a suitable example to illustrate the various part of a ConnectionString

  Best way to code radio buttons that when

What is the best way to code radio buttons that when you check a checkbox, the radio buttons become active and add a cost to the Labor Price. I already have the buttons enabled when you select muffler, I can't figure out how to code the radio butt..

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