test
This commit is contained in:
parent
37776af5db
commit
ab03d5f10c
4045 changed files with 286212 additions and 3 deletions
65
.config/Code/User/History/55863ed9/b5tt.cpp
Normal file
65
.config/Code/User/History/55863ed9/b5tt.cpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Student{
|
||||
int stdID;
|
||||
string name;
|
||||
string *courseCodes;
|
||||
int numOfCourses;
|
||||
int *courseGrades;
|
||||
float gpa;
|
||||
|
||||
public:
|
||||
|
||||
// getters
|
||||
int getStdID(){
|
||||
return stdID;
|
||||
}
|
||||
string getName(){
|
||||
return name;
|
||||
}
|
||||
string* getCourseCodes(){
|
||||
return courseCodes;
|
||||
}
|
||||
int getNumOfCourses(){
|
||||
return numOfCourses;
|
||||
}
|
||||
int* getCourseGrades(){
|
||||
return courseGrades;
|
||||
}
|
||||
float getGPA(){
|
||||
return gpa;
|
||||
}
|
||||
// setters
|
||||
void setStdID(int stdID){
|
||||
this->stdID = stdID;
|
||||
}
|
||||
void setName(string name){
|
||||
this->name = name;
|
||||
}
|
||||
// setcourse grade
|
||||
void setCourseGrade(string courseCode, int grade){
|
||||
for(int i=0;i<numOfCourses;i++){
|
||||
if(courseCodes[i] == courseCode){
|
||||
courseGrades[i] = grade;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue