#include<iostream>
#include<string>
using namespace std;
class User
{
private:
string name;
public:
string getName()
{
return name;
}
void setName(string name)
{
this->name=name;
}
User(string name)
{
this->name = name;
}
};
class ChatRoom
{
public:
void showMessage(User *user, string message)
{
cout<<"["<<user->getName()<<"] : "<<message<<endl;
}
};
int main()
{
User *robert = new User("Robert");
User *john = new User("John");
ChatRoom chatRoom;
chatRoom.showMessage(robert,"Hi! John!");
chatRoom.showMessage(john,"Hello! Robert!");
}