-
Notifications
You must be signed in to change notification settings - Fork 0
/
Student Admission And Marksheet.cpp
121 lines (115 loc) · 2.81 KB
/
Student Admission And Marksheet.cpp
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#include <iostream>
#include <string.h>
using namespace std;
class Admission
{
protected:
string sname, fname, mname;
int roll, age;
int64_t contact;
public:
void getstu()
{
cin.ignore();
cout << "\nEnter Student Name:";
getline(cin, sname);
cout << "\nEnter Father's Name:";
getline(cin, fname);
cout << "\nEnter Mother's Name:";
getline(cin, mname);
cout << "\nEnter Contact Number:";
cin >> contact;
cout << "\nEnter student roll no.:";
cin >> roll;
cout << "\nEnter student age:";
cin >> age;
}
void display()
{
cout << "\nStudent Name:" << sname;
cout << "\nFather's Name:" << fname;
cout << "\nMother's Name:" << mname;
cout << "\nContact Number:" << contact;
cout << "\nRoll NO.:" << roll;
cout << "\nAge:" << age;
}
};
class Result : public Admission
{
protected:
float physics, chemistry, maths, total;
public:
void getresult()
{
cout << "\nEnter Physics, Chemistry and Maths marks:";
cin >> physics >> chemistry >> maths;
total = physics + chemistry + maths;
}
void display()
{
cout << "\nPhysics=" << physics;
cout << "\nChemistry=" << chemistry;
cout << "\nMaths=" << maths;
cout << "\nTotal Marks excluding project marks=" << total;
}
};
class Project
{
protected:
int pro_marks;
public:
void getproject()
{
cout << "\nEnter project marks:";
cin >> pro_marks;
}
void display()
{
cout << "\nProject Marks=" << pro_marks;
}
};
class Grade : public Result, public Project
{
private:
float percentage;
char grade;
public:
void getgrade()
{
Admission::display();
Result::display();
Project::display();
cout << "\nTotal Marks including project marks=" << total + pro_marks;
percentage = (total + pro_marks) / 500 * 100;
cout << "\nPercentage obtained=" << percentage;
if (percentage > 90)
cout << "\nGrade A";
else if (percentage > 80 && percentage <= 90)
cout << "\nGrade B";
else if (percentage > 70 && percentage <= 80)
cout << "\nGrade C";
else if (percentage > 60 && percentage <= 70)
cout << "\nGrade D";
else if (percentage > 50 && percentage <= 60)
cout << "\nPass(Obtained passing percentage)";
else
cout << "\nFail.";
}
};
int main()
{
int entrance_no;
Grade G;
cout << "\nEnter Your Entrance Exam Marks:";
cin >> entrance_no;
if (entrance_no < 60)
cout << "\nNot Eligible For Admission.";
else
{
G.getstu();
G.getresult();
G.getproject();
G.getgrade();
}
return 0;
}