-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCarro.cpp
84 lines (66 loc) · 1.5 KB
/
Carro.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//============================================================================
// Name : Carro.cpp
// Author : Daniel Ferreira de Lima
// Version :
// Copyright : OpenSource use mas nao abuse
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <iterator>
#include <vector>
#include <string>
#include "Carro.h"
#include "Banco.h"
#include "Pneu.h"
#include "Motor.h"
#include "Volante.h"
#include "Ferrari.h"
#include <stdlib.h>
using namespace std;
Carro::Carro() {
cout<<"Bem vindo ao Carro!"<<endl;
}
int Carro::testar() {
Banco b;
b.aquecer();
Pneu pneu;
pneu.rodar();
Motor moto;
moto.ligar();
Volante vol;
vol.girar_direita();
vol.girar_esquerda();
}
Carro::~Carro() {
}
int main(){
Carro car;
car.testar();
Ferrari fer;
fer.testar();
fer.correr();
string ok="Ok!";
vector<int> numeros;
numeros.push_back(10);
numeros.push_back(20);
numeros.push_back(30);
numeros.push_back(40);
numeros.push_back(50);
vector<int>::iterator it;
// Declara iterador
for (it = numeros.begin(); it != numeros.end(); it++)
// Percorre vector
cout << *it << endl;
// e exibe 5 8 2
double dnumber1 = 0.0;
double dnumber2 = 0.0;
double dnumber3 = 0.0;
double daverage = 0.0;
cout << "Please enter 3numbers:"<<endl;
cin >> dnumber1;
cin >> dnumber2;
cin >> dnumber3;
daverage = (dnumber1 + dnumber2 + dnumber3 ) /3;
cout << "Average: " << daverage;
return 0;
}