Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lp1-2020.5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Samuel Oliveira
lp1-2020.5
Commits
89cab0e5
Commit
89cab0e5
authored
Jul 04, 2020
by
Samuel Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Métodos adicionados
parent
bd183073
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
0 deletions
+19
-0
a.out
a.out
+0
-0
carro.cpp
carro.cpp
+9
-0
carro.hpp
carro.hpp
+4
-0
main.cpp
main.cpp
+6
-0
No files found.
a.out
View file @
89cab0e5
No preview for this file type
carro.cpp
View file @
89cab0e5
#include "carro.hpp"
void
Carro
::
acelera
(
int
velocidade
){
this
->
velocidade
+=
velocidade
;
}
void
Carro
::
freia
(
int
velocidade
){
this
->
velocidade
-=
velocidade
;
}
\ No newline at end of file
carro.hpp
View file @
89cab0e5
...
...
@@ -7,4 +7,8 @@ class Carro{
string
tipo
;
string
placa
;
int
numPortas
;
int
velocidade
;
void
acelera
(
int
velocidade
);
void
freia
(
int
velocidade
);
};
\ No newline at end of file
main.cpp
View file @
89cab0e5
...
...
@@ -12,4 +12,10 @@ int main(){
cout
<<
"Tipo do carro: "
<<
c
.
tipo
<<
endl
;
cout
<<
"Quantidade de portas: "
<<
c
.
numPortas
<<
endl
;
cout
<<
"Placa do carro: "
<<
c
.
placa
<<
endl
;
c
.
acelera
(
50
);
cout
<<
"A velocidade atual é: "
<<
c
.
velocidade
<<
"KM/H"
<<
endl
;
c
.
freia
(
20
);
cout
<<
"A velocidade atual é: "
<<
c
.
velocidade
<<
"KM/H"
<<
endl
;
return
0
;
}
\ No newline at end of file
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