-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab3.1.cpp
55 lines (46 loc) · 1.01 KB
/
lab3.1.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
#include<iostream>
using namespace std;
class StudentDetails
{
int b=0;
string name;
int SubjectMarks[7];
int TotalMarks;
int ask;
public:
void ReadDetails();
void DisplayDetails();
};
void StudentDetails :: ReadDetails()
{
int x=0;
cout<<"Enter the name of student \n";
cin>>name;
cout<<"Enter the marks subjects of OOP,DL,EDC,EEM,EM,ECT,MATH_iii \n";
for (int i=0;i<7;i++)
{
cin>>x;
SubjectMarks[i]=x;
b=b+SubjectMarks[i];
}
}
void StudentDetails :: DisplayDetails()
{
cout<<"Your Result \n";
if(b>=630)
cout<<"Congrats you passed with A+ Grade";
else if(b<630 && b>560)
cout<<"WoW! you passed with A Grade";
else if(b>=560 && b>455 )
cout<<"YOU have passed with B Grade";
else
cout<<"SORRY! YOU HAVE GOT c GRADE";
cout<<"\n"<<name <<"\nYour total marks ::\n"<<b;
}
int main()
{
StudentDetails ClassTen;
ClassTen.ReadDetails();
ClassTen.DisplayDetails();
return 0;
}