Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vilém Strachoň
dedicnost
Commits
8889a068
Commit
8889a068
authored
4 years ago
by
Vilém Strachoň
Browse files
Options
Download
Email Patches
Plain Diff
Add new file
parents
master
No related merge requests found
Pipeline
#1949
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lama.cpp
+53
-0
lama.cpp
with
53 additions
and
0 deletions
+53
-0
lama.cpp
0 → 100644
+
53
-
0
View file @
8889a068
#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
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets