-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.cpp
More file actions
67 lines (53 loc) · 1.13 KB
/
Student.cpp
File metadata and controls
67 lines (53 loc) · 1.13 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
#include "Student.h"
#include <iostream>
void Student::display() const {
std::cout<<"Student ID: "<<id<<" ";
std::cout<<"Name: "<<name<<" ";
std::cout<<"Surname: "<<surname<<" ";
std::cout<<"Age: "<<age<<" ";
std::cout<<"GPA: "<<gpa<<std::endl;
}
void Student::setData(int id, std::string name, std::string surname, int age, float gpa) {
this->id = id;
this->name = name;
this->surname = surname;
this->age = age;
this->gpa = gpa;
}
void Student::setId(int id) {
this->id = id;
}
void Student::setAge(int age) {
this->age = age;
}
void Student::setGpa(float gpa) {
this->gpa = gpa;
}
void Student::setName(std::string name) {
this->name = name;
}
void Student::setSurname(std::string surname) {
this->surname = surname;
}
int Student::getId() const {
return id;
}
std::string Student::getName() const {
return name;
}
std::string Student::getSurname() const {
return surname;
}
int Student::getAge() const {
return age;
}
float Student::getGpa() const {
return gpa;
}
Student::Student() {
id = 0;
name = "";
surname = "";
age = 0;
gpa = 0.0;
}