Commit 8889a068 authored by Vilém Strachoň's avatar Vilém Strachoň
Browse files

Add new file

parents
No related merge requests found
Pipeline #1949 failed with stages
Showing with 53 additions and 0 deletions
+53 -0
lama.cpp 0 → 100644
#include <iostream>
using namespace std;
class Animal {
public:
void eat() {
cout << "I can eat!" << endl;
}
void sleep() {
cout << "I can sleep!" << endl;
}
};
class Dog : public Animal {
public:
void bark() {
cout << "I am dog and I can bark! Woof woof!!\n" << endl;
}
};
class Lama : public Animal {
private:
string name;
public:
Lama(string name) {
this->name = name;
}
void Spit() {
cout << "I am lama and my name is " << name << endl;
}
};
int main() {
Dog dog1;
dog1.eat();
dog1.sleep();
dog1.bark();
Lama lama("Arnostka");
lama.eat();
lama.sleep();
lama.Spit();
return 0;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment