#include <iostream>
#include <conio.h>
using namespace std;
class Room
{
public:
void Set_Capacity(int newCapacity)
{
roomCapacity = newCapacity;
}
int Change_Status(int newValue)
{
if (newValue < roomCapacity)
{
roomStatus = newValue;
return roomStatus;
}
else
return -1;
}
private:
int roomCapacity;
int roomStatus;
};
int main()
{
Room room;
room.Set_Capacity(40);
int newStatus;
cout << "Enter the new status for the room: ";
cin >> newStatus;
room.Change_Status(newStatus);
cout << "There is "<< room.Change_Status(newStatus);
_getch();
return 0;
}
Comments