Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#ifndef AHREF_EMPLOYEE
- //#define AHREF_EMPLOYEE
- //#pragma once
- #include <iostream>
- using namespace std;
- class Employee{
- protected:
- static int enextID;
- private:
- int ID;
- string username;
- string password;
- bool manager;
- public:
- Employee(string username,string password,bool manager){
- ID = enextID++;
- this->username = username;
- this->password = password;
- this->manager = manager;
- }
- ~Employee(){enextID--;}
- void Employee::grantManager(){
- this->manager = true;
- }
- void Employee::revokeManager(){
- this->manager = false;
- }
- string Employee::getUsername(){
- return username;
- }
- string Employee::getPassword(){
- return password;
- }
- bool Employee::getAccess(){
- return manager;
- }
- int Employee::getID(){
- return ID;
- }
- };
- int Employee::enextID = 0;
- int main(){
- Employee test("kira", "zaki", false);
- Employee test2("zaki", "kira", true);
- cout << test.getID() << endl;
- cout << test2.getID() << endl;
- int i = 0;
- cin >> i;
- return 0;
- }
- //#endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement