Using the attached specification file(RoomType.h) for an ADT called RoomType , implement/define all the member functions for
Fantastic news! We've Found the answer you've been seeking!
Question:
Using the attached specification file(RoomType.h) for an ADT calledRoomType, implement/define all the member functions forRoomTypeand save your code in a file called RoomType.cpp. Then use the given test driver (RoomTypeDriver.cpp) to test your implementation.
Note: Do not change RoomType.h and RoomTypeDriver.cpp
//RoomType.h//This is the header file that gives the class specification//for ADT RoomType. RoomType models a hotel room in real-world.#include #include using namespace std; class RoomType{public: RoomType(); //constructor--use it to initialize the data members unsigned int GetRoomNo();//return roomNo string GetName();//return name char GetStatus();//return status void Print();//print out roomNo, name, and status void SetRoom(unsigned int newNumber, string newName, char newStatus); //use the function parameters to set the values in the data members //e.g. roomNo=newNumber; private: unsigned int roomNo; //room number string name; //guest name char status; //'R' for reserved or 'A' for available};#include "RoomType.h"int main(){ RoomType newRoom; newRoom.Print(); newRoom.SetRoom(111, "Joshua", 'R'); newRoom.Print(); cout cout cout return 0;}
Posted Date: