Ask Chemistry Expert

A C# console program showing composition among classes

Abstract:
You work in a travel company and are upgrading the programs they use to make reservations. Reservations are made by customers for hotel rooms at different destinations. The reservations also include the airline ticket information. However, this information is stored in several different tables in the database. Your project manager informs you that you have to model the classes in your program based on the tables in the database....but that saving the information and reading them will be done later.
.......You ask one of the other programmers how to do this and your coworker says "What you need to do is to have the Flight and Room as separate classes and then make a Reservation class that has one of each of them as internal objects. The system is going to be passing all of them together to different places too and it would be better to do it as a composite object because that's the way we think about it in our company."

Instructions:
 Create a class called Flight with a FlightID (String) and price (decimal). Include a constructor that takes both values, and  get() and set() properties for both data attributes.

 Create a class called Room with a RoomID (String), HotelName(String), DaysReserved(String to keep it simple here) and price (decimal). Include a constructor that takes all four values, and get() and set() properties for all four data attributes.

 Create a class called Reservation that has a Flight Object, Room Object and a CustomerID(String). Include a constructor, get() and set() property for the CustomerID(). You may include get() and set() methods for the Flight and Room objects to work with them like will be shown in a class example during the lecture -or- create the objects first and pass them in through the constructor like the Employee class does with its 2 Dates in chapter 10. (Either way is fine and it is completely up to you.) ...Also create a toString() method in the Reservation that reports the reservation price of the flight and the room that are inside it added together, as well as all of the other information including the CustomerID, FlightID, RoomID, HotelName, and DaysReserved.

Note on common errors on similar assignments in past classes:
Do not have a decimal variable to store a price in the Reservation.
Do not have a FlightID, RoomID, HotelName, or DaysReserved in Reservation.
(This data is all stored in the internal objects. Having them in the outer class and not using these values stored in the inner classes will be a major deduction because this assignment is on composition.)

Create a class called ReservationTest that creates 2 Reservations with all of their values, then prints out all of the information for that reservation to the screen for the user.

To make this simpler, you do not have to get the data from the user to put inside of these reservations. You can hard code the values like is done on the dates and employees.

Chemistry, Academics

  • Category:- Chemistry
  • Reference No.:- M91737920
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Chemistry

Question 1bonding energyi draw an energy level diagram for

Question 1: Bonding Energy i. Draw an energy level diagram for a single Na ion and Cl ion. ii. Explain what is happening to the energy level between these two ions in terms of the Potential Energy. iii. Which process uti ...

Wat is the molarity to the hundredths place of 50 g hpo3

What is the molarity, to the hundredths place, of 5.0 g HPO3 in 300. mL of solution?

Describe how to assign anbspoxidation number from

Describe how to assign a Oxidation number from the text: The oxidation number of an atom in an elemental substance is zero. The oxidation number of a monatomic ion is equal to the ion's charge. Oxidation numbers for comm ...

How many grams of h2so4 must be dissolved into 0709 l of

How many grams of H2SO4 must be dissolved into 0.709 L of solution to generate a concentration of 0.303 M?

What could a source of error be during a titration lab that

What could a source of error be during a titration lab that is not a humans fault?

How many moles of magnesium ion are present in 525g

How many moles of magnesium ion are present in 5.25g Mg 3 (PO 4 ) 2 ?

What is the volume of a solution with a concentration of 12

What is the volume of a solution with a concentration of 1.2 M that contains 12 g of NaOH?

What is the molarity of a solution made by dissolving 200 g

What is the molarity of a solution made by dissolving 20.0 g of CrCl2 in 0.150 L of solution?

What is the mass of naoh present in grams given that a 100

What is the mass of NaOH present in grams, given that a 100. mL solution has a concentration of 0.125 M?

What is the volume of a solution in milliliters that

What is the volume of a solution, in milliliters, that contains 1.5 g LiNO3 and has a concentration of 0.40 M?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As