Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using the attached specification file(RoomType.h) for an ADT called RoomType , implement/define all the member functions for RoomType and save your code in a file
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;}Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started