Search

Solution Cart

Remove item Thumbnail image Product Price Quantity Subtotal
× LAB EXERCISE 1 (PART 2) Based on the given codes for Hotel.h and main.cpp, create Hotel.cpp so that the output will be as shown below: Room Bookings: Room 0 booked by Alice for 3 nights Room 1 booked by Bob for 2 nights Room 3 booked by Carol for 4 nights Room Bookings: Room 0 booked by Alice for 3 nights Room 3 booked by Carol for 4 nights ...Program finished with exit code 0 Press ENTER to exit console. Hotel.h #ifndef HOTEL_H #define HOTEL_H #include #include class Reservation { public: Reservation(int roomNumber, const std::string& guestName, int nights); int getRoomNumber() const; const std::string& getGuestName() const; int getNights() const; private: int roomNumber; std::string guestName; int nights; }; class Hotel { public: Hotel(int numRooms); Hotel(); bool bookRoom(int roomNumber, const std::string& guestName, int nights); bool cancelBooking(int roomNumber); void displayBookings() const; private: int numRooms; std::vector reservations; bool* roomAvailability; }; #endif Main.cpp #include "Hotel.h" #include int main() { Hotel hotel(10); // Creating a hotel with 10 rooms hotel.bookRoom(0, "Alice", 3); hotel.bookRoom(1, "Bob", 2); hotel.bookRoom(3, "Carol", 4); hotel.displayBookings(); hotel.cancelBooking(1); hotel.displayBookings(); return 0; } LAB EXERCISE 1 PART 2 Based on the given codes forr Hotelh and maincpp create Hotelcpp so that $5.00
$5.00
× Write a program that implements and uses a class called MyRectangle. Data items should include: length, width, color, and label. Define properties with appropriate accessor functions for each of the data items. Methods should include a default constructor that sets values to the empty string or zero, a constructor that allows the user to specify all values for the data items, a member method that computes and returns the area of the shape, and a member method called DisplayShape that outputs all the information (including the area via the ComputeArea method for the given rectangle in a reasonable format. 4. Write a program that implements and uses a class called MyRectangle. Data items should include:… $10.00
$10.00

Cart totals

Subtotal $15.00
Total $15.00

Free Worldwide shipping

On all orders above $50

Easy 30 days returns

30 days money back guarantee

International Warranty

Offered in the country of usage

100% Secure Checkout

PayPal / MasterCard / Visa