test
This commit is contained in:
parent
37776af5db
commit
ab03d5f10c
4045 changed files with 286212 additions and 3 deletions
47
.config/Code/User/History/65fa822f/0gZG.cpp
Normal file
47
.config/Code/User/History/65fa822f/0gZG.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student *students;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code){
|
||||
students = new Student[2];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
28
.config/Code/User/History/65fa822f/4lR7.cpp
Normal file
28
.config/Code/User/History/65fa822f/4lR7.cpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Course{
|
||||
|
||||
};
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Course *courses;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
27
.config/Code/User/History/65fa822f/8xKB.cpp
Normal file
27
.config/Code/User/History/65fa822f/8xKB.cpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Course{
|
||||
|
||||
};
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Course *courses;
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
35
.config/Code/User/History/65fa822f/FO31.cpp
Normal file
35
.config/Code/User/History/65fa822f/FO31.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Course{
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
40
.config/Code/User/History/65fa822f/JDVx.cpp
Normal file
40
.config/Code/User/History/65fa822f/JDVx.cpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
string code;
|
||||
Student s1, s2;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
58
.config/Code/User/History/65fa822f/LQLL.cpp
Normal file
58
.config/Code/User/History/65fa822f/LQLL.cpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student **students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student*[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
friend ostream& operator<<(ostream& out, Course& course);
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Course& course){
|
||||
out<<"Course name: "<<course.name<<endl;
|
||||
out<<"Course code: "<<course.code<<endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
22
.config/Code/User/History/65fa822f/MiT2.cpp
Normal file
22
.config/Code/User/History/65fa822f/MiT2.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Course{
|
||||
|
||||
};
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
57
.config/Code/User/History/65fa822f/Mutr.cpp
Normal file
57
.config/Code/User/History/65fa822f/Mutr.cpp
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student **students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student*[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
friend ostream& operator<<(ostream& out, Course& course);
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Course& course){
|
||||
out<<"Course name: "<<course.name<<endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
13
.config/Code/User/History/65fa822f/Ni9w.cpp
Normal file
13
.config/Code/User/History/65fa822f/Ni9w.cpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
53
.config/Code/User/History/65fa822f/OQdA.cpp
Normal file
53
.config/Code/User/History/65fa822f/OQdA.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student *students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = *s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
53
.config/Code/User/History/65fa822f/OqG0.cpp
Normal file
53
.config/Code/User/History/65fa822f/OqG0.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student **students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student*[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
friend ostream& operator<<(ostream& out, Student& student);
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
57
.config/Code/User/History/65fa822f/PGGx.cpp
Normal file
57
.config/Code/User/History/65fa822f/PGGx.cpp
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student **students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student*[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
friend ostream& operator<<(ostream& out, Student& student);
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Student& student){
|
||||
|
||||
}
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
64
.config/Code/User/History/65fa822f/RVPf.cpp
Normal file
64
.config/Code/User/History/65fa822f/RVPf.cpp
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student **students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student*[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
friend ostream& operator<<(ostream& out, Course& course);
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Course& course){
|
||||
out<<"Course name: "<<course.name<<endl;
|
||||
out<<"Course code: "<<course.code<<endl;
|
||||
for(int i=0;i<course.i;i++){
|
||||
out<<"Student "<<i<<endl;
|
||||
out<<"name: "<<course.students[i]->name<<endl;
|
||||
out<<"rollno: "<<course.students[i]->rollNo<<endl;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
54
.config/Code/User/History/65fa822f/ScjE.cpp
Normal file
54
.config/Code/User/History/65fa822f/ScjE.cpp
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student **students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student*[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
63
.config/Code/User/History/65fa822f/WJbU.cpp
Normal file
63
.config/Code/User/History/65fa822f/WJbU.cpp
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student **students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student*[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
friend ostream& operator<<(ostream& out, Course& course);
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Course& course){
|
||||
out<<"Course name: "<<course.name<<endl;
|
||||
out<<"Course code: "<<course.code<<endl;
|
||||
for(int i=0;i<course.i;i++){
|
||||
out<<"Student "<<i<<endl;
|
||||
out<<"name: "<<course.students[i]->name<<endl;
|
||||
out<<"rollno: "<<course.students[i]->rollNo<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
48
.config/Code/User/History/65fa822f/YAqG.cpp
Normal file
48
.config/Code/User/History/65fa822f/YAqG.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student *students;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code){
|
||||
students = new Student[2];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
44
.config/Code/User/History/65fa822f/ay4A.cpp
Normal file
44
.config/Code/User/History/65fa822f/ay4A.cpp
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
string code;
|
||||
Student *students;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
56
.config/Code/User/History/65fa822f/d3iJ.cpp
Normal file
56
.config/Code/User/History/65fa822f/d3iJ.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student **students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student*[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
friend ostream& operator<<(ostream& out, Student& s);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
1
.config/Code/User/History/65fa822f/entries.json
Normal file
1
.config/Code/User/History/65fa822f/entries.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/OOP/lab13/q2.cpp","entries":[{"id":"Ni9w.cpp","timestamp":1714362393145},{"id":"4lR7.cpp","timestamp":1714366520389},{"id":"8xKB.cpp","timestamp":1714366544556},{"id":"MiT2.cpp","timestamp":1714366558323},{"id":"uWno.cpp","timestamp":1714366713497},{"id":"FO31.cpp","timestamp":1714366752618},{"id":"rzDw.cpp","timestamp":1714366792229},{"id":"JDVx.cpp","timestamp":1714366811477},{"id":"ay4A.cpp","timestamp":1714366828234},{"id":"laeB.cpp","timestamp":1714366868551},{"id":"luCp.cpp","timestamp":1714366882979},{"id":"0gZG.cpp","timestamp":1714366924306},{"id":"YAqG.cpp","timestamp":1714366937670},{"id":"wHxh.cpp","timestamp":1714366967724},{"id":"rtll.cpp","timestamp":1714366984251},{"id":"OQdA.cpp","timestamp":1714367009582},{"id":"ScjE.cpp","timestamp":1714367039926},{"id":"d3iJ.cpp","timestamp":1714367118832},{"id":"OqG0.cpp","timestamp":1714367130065},{"id":"PGGx.cpp","timestamp":1714367142572},{"id":"jRaR.cpp","timestamp":1714367164286},{"id":"Mutr.cpp","timestamp":1714367190430},{"id":"LQLL.cpp","timestamp":1714367205252},{"id":"vK7M.cpp","timestamp":1714367264154},{"id":"WJbU.cpp","timestamp":1714367292109},{"id":"RVPf.cpp","timestamp":1714367311944}]}
|
57
.config/Code/User/History/65fa822f/jRaR.cpp
Normal file
57
.config/Code/User/History/65fa822f/jRaR.cpp
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student **students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student*[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
friend ostream& operator<<(ostream& out, Course& course);
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Course& course){
|
||||
|
||||
}
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
46
.config/Code/User/History/65fa822f/laeB.cpp
Normal file
46
.config/Code/User/History/65fa822f/laeB.cpp
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student *students;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
47
.config/Code/User/History/65fa822f/luCp.cpp
Normal file
47
.config/Code/User/History/65fa822f/luCp.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student *students;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
53
.config/Code/User/History/65fa822f/rtll.cpp
Normal file
53
.config/Code/User/History/65fa822f/rtll.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student *students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
35
.config/Code/User/History/65fa822f/rzDw.cpp
Normal file
35
.config/Code/User/History/65fa822f/rzDw.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Course{
|
||||
|
||||
Student s1, s2;
|
||||
|
||||
};
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
32
.config/Code/User/History/65fa822f/uWno.cpp
Normal file
32
.config/Code/User/History/65fa822f/uWno.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Course{
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
62
.config/Code/User/History/65fa822f/vK7M.cpp
Normal file
62
.config/Code/User/History/65fa822f/vK7M.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student **students;
|
||||
int i;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code), i(0){
|
||||
students = new Student*[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
students[i] = s;
|
||||
i++;
|
||||
}
|
||||
|
||||
friend ostream& operator<<(ostream& out, Course& course);
|
||||
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& out, Course& course){
|
||||
out<<"Course name: "<<course.name<<endl;
|
||||
out<<"Course code: "<<course.code<<endl;
|
||||
for(int i=0;i<course.i;i++){
|
||||
out<<"Student "<<i<<endl;
|
||||
out<<course.students[i]->name<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
52
.config/Code/User/History/65fa822f/wHxh.cpp
Normal file
52
.config/Code/User/History/65fa822f/wHxh.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
struct Student{
|
||||
string name;
|
||||
int rollNo;
|
||||
Student(){}
|
||||
Student(string name, int rollNo) : name(name), rollNo(rollNo){}
|
||||
};
|
||||
|
||||
class Course{
|
||||
|
||||
string name;
|
||||
int code;
|
||||
Student *students;
|
||||
|
||||
public:
|
||||
|
||||
Course(string name, int code) : name(name), code(code){
|
||||
students = new Student[2];
|
||||
}
|
||||
|
||||
void enrollStudent(Student *s){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
Student student1("Shahood", 1001);
|
||||
Student student2("Hammad", 1002);
|
||||
Student student3("Ali", 1003);
|
||||
|
||||
Course course1("Math", 2001);
|
||||
Course course2("Physics", 2002);
|
||||
|
||||
course1.enrollStudent(&student1);
|
||||
course1.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student2);
|
||||
course2.enrollStudent(&student3);
|
||||
|
||||
cout << course1 << endl;
|
||||
cout << course1 << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue