-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclass.cpp
51 lines (41 loc) Β· 844 Bytes
/
class.cpp
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
#include <cmath>
#include <vector>
#include <iostream>
#include <algorithm>
#include "string"
using namespace std;
class Student {
private:
int age;
string first_name;
string last_name;
int standard;
public:
int get_age() {
return age;
}
void set_age(int a) {
age = a;
}
string get_first_name() {
return first_name;
}
void set_first_name(string name) {
first_name = name;
}
string get_last_name() {
return last_name;
}
void set_last_name(string name) {
last_name = name;
}
int get_standard() {
return standard;
}
void set_standard(int s) {
standard = s;
}
string to_string() {
return ::to_string(age) + "," + first_name + ',' + last_name + "," + ::to_string(standard);
}
};