Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
projeto2LP1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debora
projeto2LP1
Commits
8ee4acfd
There was a problem fetching the pipeline mini graph.
Commit
8ee4acfd
authored
8 years ago
by
Debora
Browse files
Options
Downloads
Patches
Plain Diff
fourth commit: adicionando a sobrecarga de << no animal
parent
30bde6ca
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
animal.cpp
+20
-10
20 additions, 10 deletions
animal.cpp
animal.h
+5
-5
5 additions, 5 deletions
animal.h
with
25 additions
and
15 deletions
animal.cpp
+
20
−
10
View file @
8ee4acfd
#include
"animal.h"
#include
"animal.h"
#include
<fstream>
using
namespace
std
;
Animal
::
Animal
(
int
identity
,
string
clas
,
string
name
,
string
scientific
,
char
sex
,
float
size
,
string
diet
,
string
baptism
,
Veterinario
vet
,
Tratador
caretaker
)
:
Animal
::
Animal
(
int
identity
,
string
clas
,
string
name
,
string
scientific
,
char
sex
,
float
size
,
string
diet
,
string
baptism
,
Veterinario
vet
,
Tratador
caretaker
)
:
id
(
identity
),
classe
(
clas
),
cientifico
(
scientific
),
id
(
identity
),
classe
(
clas
),
cientifico
(
scientific
),
...
@@ -87,14 +89,22 @@ void Animal::setTratador(Tratador caretaker){
...
@@ -87,14 +89,22 @@ void Animal::setTratador(Tratador caretaker){
tratador
=
caretaker
;
tratador
=
caretaker
;
}
}
istream
&
operator
>>
(
istream
&
input
,
Animal
const
&
A
)
{
// std::istream& operator>>( std::istream &input, Animal const &A ) {
input
>>
A
.
id
>>
";"
>>
A
.
classe
>>
";"
>>
A
.
nome
>>
";"
>>
A
.
cientifico
>>
";"
// input >> A.id >> ";" >> A.classe >> ";" >> A.nome >> ";" >> A.cientifico >> ";"
>>
A
.
sexo
>>
";"
>>
A
.
tamanho
>>
";"
>>
A
.
dieta
>>
";"
>>
A
.
batismo
;
// >> A.sexo >> ";" >> A.tamanho >> ";" >> A.dieta >> ";" >> A.batismo;
return
input
;
// return input;
}
// }
std
::
ostream
&
operator
<<
(
std
::
ostream
&
output
,
Animal
const
&
A
)
{
output
<<
"Id: "
<<
A
.
id
<<
endl
;
output
<<
"Nome: "
<<
A
.
nome
<<
endl
;
output
<<
"Classe: "
<<
A
.
classe
<<
endl
;
output
<<
"Nome cientifico: "
<<
A
.
cientifico
<<
endl
;
output
<<
"Sexo: "
<<
A
.
sexo
<<
endl
;
output
<<
"Tamanho :"
<<
A
.
tamanho
<<
endl
;
output
<<
"Dieta: "
<<
A
.
dieta
<<
endl
;
output
<<
"Nome de Batismo: "
<<
A
.
batismo
<<
endl
;
return
output
;
ostream
&
operator
>>
(
ostream
&
output
,
Animal
const
&
A
)
{
}
output
<<
A
.
id
<<
";"
<<
A
.
classe
<<
";"
<<
A
.
nome
<<
";"
<<
A
.
cientifico
<<
";"
<<
A
.
sexo
>>
";"
<<
A
.
tamanho
<<
";"
<<
A
.
dieta
<<
";"
<<
A
.
batismo
;
return
input
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
animal.h
+
5
−
5
View file @
8ee4acfd
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
using
namespace
std
;
using
namespace
std
;
class
Animal
{
class
Animal
{
pr
otec
te
d
:
pr
iva
te:
int
id
;
int
id
;
string
classe
;
string
classe
;
string
nome
;
string
nome
;
...
@@ -26,7 +26,7 @@ class Animal {
...
@@ -26,7 +26,7 @@ class Animal {
public:
public:
int
getId
();
int
getId
();
void
setId
(
int
identity
);
void
setId
(
int
identity
);
string
getClasse
();
string
getClasse
();
void
setClasse
(
string
clas
);
void
setClasse
(
string
clas
);
string
getNome
();
string
getNome
();
void
setNome
(
string
name
);
void
setNome
(
string
name
);
...
@@ -44,10 +44,10 @@ class Animal {
...
@@ -44,10 +44,10 @@ class Animal {
void
setVeterinario
(
Veterinario
vet
);
void
setVeterinario
(
Veterinario
vet
);
Tratador
getTratador
();
Tratador
getTratador
();
void
setTratador
(
Tratador
caretaker
);
void
setTratador
(
Tratador
caretaker
);
istream
&
operator
>>
(
istream
&
input
,
Animal
const
&
A
);
//std::
istream&
operator>>(
std::
istream &input, Animal const &A );
ostream
&
operator
<<
(
ostream
&
output
,
Animal
const
&
A
)
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
output
,
Animal
const
&
A
)
;
Animal
(
int
identity
,
string
clas
,
string
name
,
string
scientific
,
char
sex
,
float
size
,
string
diet
,
string
baptism
,
Veterinario
vet
,
Tratador
caretaker
);
Animal
(
int
identity
,
string
clas
,
string
name
,
string
scientific
,
char
sex
,
float
size
,
string
diet
,
string
baptism
,
Veterinario
vet
,
Tratador
caretaker
);
};
};
#endif
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment