Repository navigation
Expand file tree
/
Copy pathAssignment2.cpp
More file actions
107 lines (79 loc) · 1.52 KB
/
Copy pathAssignment2.cpp
File metadata and controls
107 lines (79 loc) · 1.52 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#include<iostream>
using namespace std;
class Student
{ //int avg=0;
int n;
int rollNo;
int marks;
string name;
public :
static int count, max,min,abcnt;
void getdata();
void printdata();
void avgdata();
int getmarks();
void display();
};
int Student :: count=0;
int Student :: max=0;
int Student :: min=30;
int Student :: abcnt=0;
void Student :: getdata()
{
cout<<"\nEnter The rollNo\n";
cin>>rollNo;
cout<<"\nEnter The Name\n";
cin>>name;
cout<<"\nEnter The Marks\n";
cin>>marks;
if(marks<0)
Student :: abcnt++;
else
{
if(Student :: max<marks)
Student :: max=marks;
if(Student :: min>marks)
Student :: min=marks;
}
Student :: count++;
};
//int Student :: getmarks()
//{
// return marks;
//}
void Student::printdata()
{
cout<<"\nRoll No,:"<<rollNo;
cout<<"\tName.: "<<name;
cout<<"\tMarks.: "<<marks;
cout<<"\n"<<Student::count;
};
void Student::display()
{
cout<<"The Count is,:"<<Student::count;
cout<<"\nMaximum Score:"<<Student :: max;
cout<<"\nMinimum Score:"<<Student :: min;
cout<<"\nAbsent Count :"<<Student :: abcnt;
}
//void Student :: avgdata()
//{
//}
int main()
{
int n;
//cout<<"Enter no of records";
//cin>>n;
Student s[10];
Student s1;
for(int i=0;i<10;i++)
{
s[i].getdata();
//Student :: count++;
}
for(int i=0;i<10;i++)
{
s[i].printdata();
}
s1.display();
return 0;
}