-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass-Student.cpp
More file actions
40 lines (39 loc) · 879 Bytes
/
Class-Student.cpp
File metadata and controls
40 lines (39 loc) · 879 Bytes
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
/*
**************************
Program Name :: Marks and Grade as data member
Program Description :: Write a class has marks and grades as data member .A constructor with two parameters
initilize data member with given values & member function show() display member function .
create two object and display the values .
Program Date :: June 02,2023
Program Author :: Habiba
**************************
*/
#include <iostream>
using namespace std;
class Student
{
private:
int marks ;
char grades ;
public:
Student (int m, char g)
{
marks = m ;
grades = g ;
}
void show ()
{
cout<<"Marks :"<<marks<<endl ;
cout<<"Grade :"<<grades<<endl ;
}
};
int main()
{
system ("cls");
Student s1(730 ,'A'),s2(621,'B');
cout<<"Record of student 1 :"<<endl;
s1.show();
cout<<"Record of student 2 :"<<endl;
s2.show();
return 0;
}