Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Samuel Oliveira
lp1-2020.5
Commits
6f269d22
Commit
6f269d22
authored
Jul 08, 2020
by
Samuel Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Construtor adicionado na classe Carro da aula 3
parent
413b802f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
1 deletion
+14
-1
Aula 3/Banco/a.out
Aula 3/Banco/a.out
+0
-0
Aula 3/Banco/main.cpp
Aula 3/Banco/main.cpp
+1
-1
Aula 3/Carro/a.out
Aula 3/Carro/a.out
+0
-0
Aula 3/Carro/carro.cpp
Aula 3/Carro/carro.cpp
+8
-0
Aula 3/Carro/carro.hpp
Aula 3/Carro/carro.hpp
+4
-0
Aula 3/Carro/main.cpp
Aula 3/Carro/main.cpp
+1
-0
No files found.
Aula 3/Banco/a.out
View file @
6f269d22
No preview for this file type
Aula 3/Banco/main.cpp
View file @
6f269d22
...
...
@@ -18,7 +18,7 @@ int main(){
cout
<<
"Titular da conta C: "
<<
c
.
titular
.
nome
<<
endl
;
cout
<<
"Titular da conta D: "
<<
d
.
titular
.
nome
<<
endl
;
cout
<<
"Titular da conta E: "
<<
e
.
titular
.
nome
<<
endl
;
c
.
saldo
=
20
;
c
.
saca
(
15
);
...
...
Aula 3/Carro/a.out
View file @
6f269d22
No preview for this file type
Aula 3/Carro/carro.cpp
View file @
6f269d22
#include "carro.hpp"
Carro
::
Carro
(
string
cor
){
this
->
cor
=
cor
;
}
Carro
::
Carro
(){
this
->
cor
=
"Branco"
;
}
void
Carro
::
acelera
(
int
velocidade
){
this
->
velocidade
+=
velocidade
;
}
...
...
Aula 3/Carro/carro.hpp
View file @
6f269d22
...
...
@@ -9,8 +9,12 @@ class Carro{
string
placa
;
int
numPortas
;
int
velocidade
;
string
cor
;
Motor
motor
;
Carro
(
string
cor
);
Carro
();
void
acelera
(
int
velocidade
);
void
freia
(
int
velocidade
);
void
ligaCarro
();
...
...
Aula 3/Carro/main.cpp
View file @
6f269d22
...
...
@@ -12,6 +12,7 @@ int main(){
cout
<<
"Tipo do carro: "
<<
c
.
tipo
<<
endl
;
cout
<<
"Quantidade de portas: "
<<
c
.
numPortas
<<
endl
;
cout
<<
"Placa do carro: "
<<
c
.
placa
<<
endl
;
cout
<<
"A cor do carro é: "
<<
c
.
cor
<<
endl
;
c
.
ligaCarro
();
c
.
acelera
(
50
);
cout
<<
"A velocidade atual é: "
<<
c
.
velocidade
<<
"KM/H"
<<
endl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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