Waived!

LAB EXERCISE 1 PART 2 Based on the given codes forr Hotelh and maincpp create Hotelcpp so that

(4 customer reviews)

Original price was: $10.00.Current price is: $5.00.

Download button will appear immediately after successful payment.

Full support will be provided with necessary files installation.

Get impeccable customized solution within 24 hours, hassle-free.

View Details
Solved By Verified
Study Co-Pilot All Study Co-Pilots are evaluated by Gotit Pro as an expert in their subject area.
Instant
Download

Description

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;

}


4 reviews for LAB EXERCISE 1 PART 2 Based on the given codes forr Hotelh and maincpp create Hotelcpp so that

  1. Judie Hoffman

    Great quality solution, Done way before time

  2. Caroline Riberdy

    great and amazing work, highly recommend. God bless you in all your days 🙂

  3. Guy Booker

    Thank for your help and service. I really like the work that they did on my paper.

  4. Mark Farwell

    Great job, very quick and informative! Done in an hours! Thank you for a job well done.

Only logged in customers who have purchased this product may leave a review.


You may also like…

Patron Details

Additional information

Your Solution

Product
Quantity
Total
Cart Subtotal $0.00
Order Total $0.00

  • Pay with your credit card.