-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminiproject2.cpp
More file actions
81 lines (65 loc) · 1.57 KB
/
miniproject2.cpp
File metadata and controls
81 lines (65 loc) · 1.57 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
#include <bits/stdc++.h>
using namespace std;
class student
{
public:
string name;
string usn;
void nameandusn()
{
cin >> name >> usn;
}
void displaynameandusn()
{
cout << name << ":" << usn << endl;
}
float calculate_marks(int a, int b, int c);
bool pf(float d)
{
if (d >= 40.00)
return true;
else
return false;
}
void entrance_exam();
};
float student::calculate_marks(int a, int b, int c)
{
float percentage = ((a + b + c) / 3.00) ;
cout << "the marks are: " << a << " " << b << " " << c << endl;
return percentage;
}
void student:: entrance_exam()
{
int rank;
cin>>rank;
if(rank>=5000 && rank<=15000)
cout<<"student is alloted with cs seat"<<endl;
else if(rank >15000&& rank <=30000)
cout<<"student is alloted with IS seat"<<endl;
else
cout<<"student is alloted with Ec seat"<<endl;
}
int main()
{
cout << "WELCOME TO STUDENT DATA BASE MANAGEMENT SYSTEM" << endl;
student s;
int num = 2;
while (num--)
{
cout << "enter your name and usn" << endl;
s.nameandusn();
s.displaynameandusn();
cout << "enter the marks of 3 subject" << endl;
int m1, m2, m3;
cin >> m1 >> m2 >> m3;
float res = s.calculate_marks(m1, m2, m3);
if (s.pf(res))
cout << "pass" <<" "<<"percentage is :"<<" "<<res<< endl;
else
cout << "fail" << endl;
cout << "enter your entrance exam marks" << endl;
s.entrance_exam();
}
return 0;
}