-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathperson.cpp
More file actions
38 lines (31 loc) · 836 Bytes
/
person.cpp
File metadata and controls
38 lines (31 loc) · 836 Bytes
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
//
// Created by 15086 on 2022.8.25.
//
#include "person.h"
person::person(){}
person::person(const std::string &name):name(name){}
person::person(const std::string &name, int age):person(name){this->age=age;}
void person::getup(){
std::cout<<name<<" is getting up"<<std::endl;
}
void person::eat() {
std::cout<<name<<" is eating breakfast in the person class"<<std::endl;
}
void person::sequence(){
getup();
eat();
run(name);
gotowork();
}
void person::run(std::string name){
std::cout<<"l.k. is running in class person"<<std::endl;
}
void person::gotowork(){
std::cout<<"l.k. is going to work in class person"<<std::endl;
}
person::~person(){
std::cout<<"person destructor"<<std::endl;
}
const std::string &person::getName() const {
return name;
}