-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
84 lines (78 loc) · 1.97 KB
/
main.cpp
File metadata and controls
84 lines (78 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <iostream>
#include "admin.h"
#include "employee.h"
#include "base.h"
#include "student.h"
#include "color.h"
#include "stockhandlebyadmin.h"
#include "complaint.h"
#include "adminotherdealing.h"
#include <windows.h>
using namespace std;
// Declaration of the function ar in ke andar basically ham base class
// ke pointer se start kara rah epolymorphism ko achive karne ke liye
void adminfunction();
void employeefunction();
void studentfunction();
int main()
{
int choice, choice_for_while;
show(); // this show logo of our company
markYellow();
cout << "---------------------------" << endl;
cout << "| Press 1 for Admin |" << endl;
cout << "| Press 2 for Employee |" << endl;
cout << "| Press 3 for Student |" << endl;
cout << "| Press 0 to Exit |" << endl;
cout << "---------------------------" << endl;
resetColor();
markBlue();
cout << "Enter the corresponding number: ";
resetColor();
do
{
cin >> choice;
switch (choice)
{
case 1:
adminfunction();
break;
case 2:
employeefunction();
break;
case 3:
studentfunction();
break;
default:
markRed();
cout << "Invalid input ";
cout << "do you want to try again ? " << endl;
resetColor();
markGreen();
cout << "press 0 for exit or press any key to continue" << endl;
resetColor();
cin >> choice_for_while;
break;
}
} while (choice_for_while != 0);
return 0;
}
// Definition of the function
void adminfunction()
{
Base *b = nullptr;
admin ad;
b = &ad;
}
void employeefunction()
{
Base *b = nullptr;
Employee emp;
b = &emp;
}
void studentfunction()
{
Base *b = nullptr;
student stu;
b = &stu;
}