Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Tester.java: Expected output: Hotel Baba Mama, 3.5 stars. Hotel Owners: Ali Baba Alice Mama Rooms : SINGLE, price=$35.5, Size=200.0, Number=101, Floor=1, Single Room without view

image text in transcribedimage text in transcribedimage text in transcribed

Tester.java:

image text in transcribedimage text in transcribedimage text in transcribed

Expected output: Hotel Baba Mama, 3.5 stars. Hotel Owners: Ali Baba Alice Mama Rooms : SINGLE, price=$35.5, Size=200.0, Number=101, Floor=1, Single Room without view DOUBLE, price=$50.5, Size=350.0, Number=102, Floor=1, Double Room without view DOUBLE, price=$55.0, Size=400.0, Number=201, Floor=2, Double Room with view SUITE, price=$80.0, Size=500.0, Number=202, Floor=2, Suite Room with view and balcony Room 102 Reservation successful. Reservation number: 10001 Room 102 Reservation successful. Reservation number: 10002 Room 101 Reservation successful. Reservation number: 10003 Sorry, Reservation was not successful. Check the room availability. Room 102 is checked in. Reservation 10003 is canceled. Rooms Statuses 1 Reservation list of room number 101: Vacant. Reservation list of room number 102: Occupied. Reservation Number: 10001. From: 2021-03-06 To: 2021-03-08, Guest: Joe Uncle, $50.5 per night. Reservation Number: 10002. From: 2021-04-02 To: 2021-04-04, Guest: Lu Brother, $52.0 per night. Reservation list of room number 201: Vacant. Reservation list of room number 202: Vacant. Problem Statement (Summary): You are going to develop a simple application for Hotels. Hotel is, actually, a Building, with some extra features. Each hotel as a couple of rooms. Each room, has some features, including its own calendar, to keep its reservation records. To implement and test this system, you must create six Java classes as follows: Class Tester (20 marks): For this part, you have two options: Option 1: You can complete the tester class, Tester.java, that is provided. You must read every comment and provide the required code to fulfill it. You can also get help and idea from the sample execution outputs provided below. (20 marks) Option 2: You can develop your own tester class, Tester.java. If you select this option, your tester class must generate outputs similar to the sample execution outputs provided below. This means, the main method of your tester class must: Create a hotel, with at least two owners and four rooms (6 marks) Show the hotel and its rooms' information, similar to the sample outputs (4 marks) Perform three successful and one unsuccessful room reservations and show the results (6 marks) o Change the current price of a room (1 mark) Cancel one existing reservation (1 mark) Show the statuses of all the rooms (2 marks) O O O import java.sql.Date; import java.time. Year; import java.util.ArrayList; public class Tester { public static void main(String[] args) { // Create a 3.5 stars hotel, named "Baba-Mama", built in 2018, with two floors 1/ The owners' "firstname last name"'s of the hotel are "Ali Baba" and "Alice Mama". // Adding some rooms to this new hotel I/ SINGLE, price=$35.50, size=200, floor=1, number=101, description="Single Room without view"); // Double, price=$50.50, size=350, floor=1, number=102, description="Double Room without view"); 1/ Double, price=$55.00, size=400, floor=2, number=201, description="Double Room with view"); 1/ Suite, price=80.00, size=500, floor=2, number=202, description="Suite Room with view and balcony"); 1/ Show the hotel information, including its rooms // Reserve the room number 102 for "Joe Uncle", checkin March 6, 2021, checkout March 8, 2021 1/ Print out the reservation result 1/ Change the price of the room 102 to $52.00 1/ Reserve the room number 102 for "Mike Brother", checkin April 2, 2021, checkout April 4, 2021 // Print out the reservation result 1/ Reserve the room number 101 for "Maria Aunt", checkin May 27, 2021, checkout May 28, 2021 // Print out the reservation result 1/ Reserve the room number 101 for "laura Sister", checkin May 25, 2021, checkout May 28, 2021 // Print out the reservation result // Check in the room 102 1/ Cancel reservation number 10003 and show the cancellation result // Show all the statuses of all the rooms } } Expected output: Hotel Baba Mama, 3.5 stars. Hotel Owners: Ali Baba Alice Mama Rooms : SINGLE, price=$35.5, Size=200.0, Number=101, Floor=1, Single Room without view DOUBLE, price=$50.5, Size=350.0, Number=102, Floor=1, Double Room without view DOUBLE, price=$55.0, Size=400.0, Number=201, Floor=2, Double Room with view SUITE, price=$80.0, Size=500.0, Number=202, Floor=2, Suite Room with view and balcony Room 102 Reservation successful. Reservation number: 10001 Room 102 Reservation successful. Reservation number: 10002 Room 101 Reservation successful. Reservation number: 10003 Sorry, Reservation was not successful. Check the room availability. Room 102 is checked in. Reservation 10003 is canceled. Rooms Statuses 1 Reservation list of room number 101: Vacant. Reservation list of room number 102: Occupied. Reservation Number: 10001. From: 2021-03-06 To: 2021-03-08, Guest: Joe Uncle, $50.5 per night. Reservation Number: 10002. From: 2021-04-02 To: 2021-04-04, Guest: Lu Brother, $52.0 per night. Reservation list of room number 201: Vacant. Reservation list of room number 202: Vacant. Problem Statement (Summary): You are going to develop a simple application for Hotels. Hotel is, actually, a Building, with some extra features. Each hotel as a couple of rooms. Each room, has some features, including its own calendar, to keep its reservation records. To implement and test this system, you must create six Java classes as follows: Class Tester (20 marks): For this part, you have two options: Option 1: You can complete the tester class, Tester.java, that is provided. You must read every comment and provide the required code to fulfill it. You can also get help and idea from the sample execution outputs provided below. (20 marks) Option 2: You can develop your own tester class, Tester.java. If you select this option, your tester class must generate outputs similar to the sample execution outputs provided below. This means, the main method of your tester class must: Create a hotel, with at least two owners and four rooms (6 marks) Show the hotel and its rooms' information, similar to the sample outputs (4 marks) Perform three successful and one unsuccessful room reservations and show the results (6 marks) o Change the current price of a room (1 mark) Cancel one existing reservation (1 mark) Show the statuses of all the rooms (2 marks) O O O import java.sql.Date; import java.time. Year; import java.util.ArrayList; public class Tester { public static void main(String[] args) { // Create a 3.5 stars hotel, named "Baba-Mama", built in 2018, with two floors 1/ The owners' "firstname last name"'s of the hotel are "Ali Baba" and "Alice Mama". // Adding some rooms to this new hotel I/ SINGLE, price=$35.50, size=200, floor=1, number=101, description="Single Room without view"); // Double, price=$50.50, size=350, floor=1, number=102, description="Double Room without view"); 1/ Double, price=$55.00, size=400, floor=2, number=201, description="Double Room with view"); 1/ Suite, price=80.00, size=500, floor=2, number=202, description="Suite Room with view and balcony"); 1/ Show the hotel information, including its rooms // Reserve the room number 102 for "Joe Uncle", checkin March 6, 2021, checkout March 8, 2021 1/ Print out the reservation result 1/ Change the price of the room 102 to $52.00 1/ Reserve the room number 102 for "Mike Brother", checkin April 2, 2021, checkout April 4, 2021 // Print out the reservation result 1/ Reserve the room number 101 for "Maria Aunt", checkin May 27, 2021, checkout May 28, 2021 // Print out the reservation result 1/ Reserve the room number 101 for "laura Sister", checkin May 25, 2021, checkout May 28, 2021 // Print out the reservation result // Check in the room 102 1/ Cancel reservation number 10003 and show the cancellation result // Show all the statuses of all the rooms } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

Are you proud of yourself?

Answered: 1 week ago

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago

Question

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago