-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLabactivity.cpp
More file actions
116 lines (106 loc) · 2.11 KB
/
Labactivity.cpp
File metadata and controls
116 lines (106 loc) · 2.11 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
108
109
110
111
112
113
114
115
116
//By Aadhaar Koul
//Rollnumber 2020a1r040
//Section A1
#include <iostream>
using namespace std;
class student
{
public:
int rollno;
string name;
float marks;
student();
~student();
void getdata();
void putdata();
void updatedata();
void putnewdata();
// void searchstudent();
};
class StudentCourse
{
private:
string course;
int credits;
public:
void getdata();
void putdata();
StudentCourse(string course , int credits )
{
}
void updatecourse();
~StudentCourse();
};
student :: student()
{
cout << "Students details using constructior" << endl;
}
//
void StudentCourse ::getdata()
{
cout << "Enter Course Name: ";
cin >> course;
cout << "Enter Credits: ";
cin >> credits;
}
void student ::getdata()
{
cout << "Enter the rollno:";
cin >> rollno;
cout << "Enter the name:";
cin >> name;
cout << "Enter the marks:";
cin >> marks;
}
void StudentCourse ::putdata()
{
cout << "Course Name: " << course << endl;
cout << "Credits: " << credits << endl;
}
void student ::putdata()
{
cout << "Rollno:" << rollno << endl;
cout << "Name:" << name << endl;
cout << "Marks:" << marks << endl;
}
void student::updatedata()
{
rollno = 20;
name = "Bill";
marks = 100;
}
void student::putnewdata()
{
cout<<"Updated Data"<<endl;
cout << "Rollno:" << rollno << endl;
cout << "Name:" << name << endl;
cout << "Marks:" << marks << endl;
cout << endl << endl;
cout<<"Student data deleted using a Member function"<<endl;
}
// void StudentCourse :: updatecourse()
// {
// }
student ::~student()
{
delete this;
}
StudentCourse ::~StudentCourse()
{
delete this;
}
int main()
{
student s;
StudentCourse sc;
cout << "COURSE DETAILS" << endl;
sc.getdata();
cout << endl;
//s.searchstudent()
s.updatedata();
s.putnewdata();
//Parameterized Constructor Overloading
StudentCourse("Cyber" , 100);
sc.updatecourse();
return 0;
}