First version using OOP
This commit is contained in:
21
Gato.cpp
Normal file
21
Gato.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "Gato.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
Gato::Gato(std::string nome){
|
||||
cout << "Nasce um gatinho chamado " << nome << endl;
|
||||
_nome = nome;
|
||||
}
|
||||
|
||||
Gato::~Gato(){
|
||||
cout << "E " << _nome << " nos deixou" << endl;
|
||||
}
|
||||
|
||||
void Gato::acorda(){
|
||||
mia();
|
||||
}
|
||||
|
||||
void Gato::mia(){
|
||||
cout << _nome << " faz MIAU" << endl;
|
||||
}
|
||||
Reference in New Issue
Block a user