Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class student {
- private:
- string name;
- string surname;
- int age;
- public:
- student() {
- }
- student(string _name, string _surname, int _age) {
- name = _name;
- surname = _surname;
- age = _age;
- }
- string get_name() {
- return name;
- }
- string get_surname() {
- return surname;
- }
- int get_age() {
- return age;
- }
- void set_name(string _name) {
- name = _name;
- }
- void set_surname(string _surname) {
- surname = _surname;
- }
- void set_age(int _age) {
- age = _age;
- }
- };
- int main() {
- student s("pavle", "pavlevski", 20);
- s.set_surname("trpeski");
- s.set_age(100);
- cout << s.get_name() << " " << s.get_surname() << " " << s.get_age() << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement