Trying to Create a game where the will be a Regular User and an Admin, in C++ but Stucked when I have to get the inheritance correct. Who to Inherit

In C++ I am trying the subject of OOP in the line of creating a console-based game with a regular user and the admin. Where admin can add new users, add game rules, and more. While the user can only play the game without having access to the ability of the admin.

Now I am trying to get a way to have the user to inherit from the admin but the user should not get the privilege of all the admin functions like changing password add game rules and so forth.

class admin{
string name 
string password
changePAssword();
changeRules();
addNewGames();

};
class user: public admin{
string name 
string password

void play();
void login();
void quit();
} ```


//The user does not have to be able to function as an admin and vice-versa.
 For example, in MCQ game I have a question and answer choices the user can put their choice but cannot change the choices and questions only the admin has such rights.








from Recent Questions - Stack Overflow https://ift.tt/3aFQEVt
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation