Please explain the idea for each line of this code especially the entire part after "private:" and to the "int main()".
Doesn't need to be a long explanation just a clear short sentence should be enough.
The Code is in .cpp:
//------------------------------------------------------------- #include // Required for cout using namespace std; // Required for cout //------------------------------------------------------------- /// A simple class to encapsulate the concept of a hotel room booking //------------------------------------------------------------- // Copyright Napat Sanguandeekul // Input arguments: A sets of test data (numbers) for testing if the class and // : overall code process properly according to client demand output // : // Output : Display the Number of Customers, Rooms, Nights and the total Cost of Stay // Header file : None //------------------------------------------------------------- class roomBooking; //------------------------------------------------------------- class roomBooking { public: roomBooking(unsigned int _roomNumber, unsigned int _customerNumber, float _costPerNight, unsigned int _numberOfNights); /// 5% and for implementation below roomBooking(const roomBooking& L); /// 5% and for implementation below roomBooking& operator=(const roomBooking& L); /// 5% and for implementation below ~roomBooking(){} /// 3% and for implementation below //------------------------------------------------------------- // Note careful selection of which sets & gets to provide unsigned int get_customerNumber(){return(customerNumber);} /// All gets and sets 2% unsigned int get_numberOfNights(){return(numberOfNights);} void set_customerNumber(unsigned int _customerNumber){customerNumber=_customerNumber;} void set_numberOfNights(unsigned int _numberOfNights){numberOfNights=_numberOfNights;} float costOfStay(); void printBill(); private: /// 5% unsigned int roomNumber; unsigned int customerNumber; float costPerNight; // unsigned int numberOfNights; }; //--------------------------------------------------------------------------- roomBooking::roomBooking(unsigned int _roomNumber, unsigned int _customerNumber, float _costPerNight, unsigned int _numberOfNights) :roomNumber(_roomNumber), customerNumber(_customerNumber), costPerNight(_costPerNight), numberOfNights(_numberOfNights){} //--------------------------------------------------------------------------- roomBooking::roomBooking(const roomBooking& rB) :roomNumber(rB.roomNumber), customerNumber(rB.customerNumber), costPerNight(rB.costPerNight), numberOfNights(rB.numberOfNights){} //--------------------------------------------------------------------------- roomBooking& roomBooking::operator=(const roomBooking& rB){ if(this==&rB) return(*this); roomNumber=rB.roomNumber; customerNumber=rB.customerNumber; costPerNight=rB.costPerNight; numberOfNights=rB.numberOfNights; return(*this); } //--------------------------------------------------------------------------- float roomBooking::costOfStay(){ // As above return(costPerNight*float(numberOfNights)); } //--------------------------------------------------------------------------- void roomBooking::printBill(){ // As above cout<<" customerNumber="<
There are 3 Steps involved in it
Step: 1