-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto.h
135 lines (129 loc) · 2.75 KB
/
auto.h
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*----------------------------------
*
* Proyecto POO 2
* Fecha: 13 Junio 2020
* Autor: A001701350 Jorge Alan Ramirez Elias
*
-----------------------------------
Descripcion de la fucionalidad de la clase*/
#ifndef AUTO_H
#define AUTO_H
#include <string>
using namespace std;
class Auto{
private:
double precio;
int id;
string estado;
string marca;
string modelo;
string color;
string transmision;
string tipoDeCombustible;
float rendimiento;
float capacidadAl;
string direccion;
int puertas;
string traccion;
public:
Auto ();
Auto(double price,int iD,string mar , string mod,string col , string tran,string tdc, float ren, float cap,string dir,int pue,string trac);
double getPrecio();
int getId();
string getEstado();
string getMarca();
string getModelo();
string getColor();
string getTransmision();
string getTipoDeCombustible();
float getRendimiento();
float getCapacidadAl();
string getDireccion();
int getPuertas();
string getTraccion();
void setPrecio(double nuevoPrecio);
void setEstado(string nuevoEstado);
void setId(int nuevaId);
virtual string toString() =0;
};
Auto :: Auto(){
estado = "Disponible";
marca = "undefined";
modelo = "undefined";
color = "undefined";
transmision = "undefined";
puertas=0;
traccion ="undefined";
direccion = "undefined";
tipoDeCombustible ="undefined";
rendimiento=0;
capacidadAl=0;
precio=0;
id=0;
}
Auto:: Auto(double price,int iD, string mar , string mod,string col , string tran,string tdc, float ren, float cap,string dir,int pue,string trac){
estado = "Disponible";
marca = mar;
modelo = mod;
color = col;
transmision = tran;
direccion = dir;
puertas = pue;
traccion = trac;
tipoDeCombustible =tdc;
rendimiento = ren;
capacidadAl= cap;
direccion = dir;
puertas = pue;
precio= price;
id=iD;
}
double Auto :: getPrecio(){
return precio;
}
int Auto :: getId(){
return id;
}
string Auto :: getEstado(){
return estado;
}
string Auto :: getMarca(){
return marca;
}
string Auto :: getModelo(){
return modelo;
}
string Auto :: getColor(){
return color;
}
string Auto :: getTransmision(){
return transmision;
}
string Auto :: getTipoDeCombustible(){
return tipoDeCombustible;
}
float Auto :: getRendimiento(){
return rendimiento;
}
float Auto :: getCapacidadAl(){
return capacidadAl;
}
string Auto :: getDireccion(){
return direccion;
}
int Auto :: getPuertas(){
return puertas;
}
string Auto :: getTraccion(){
return traccion;
}
void Auto :: setPrecio(double nuevoPrecio){
precio = nuevoPrecio;
}
void Auto :: setEstado (string nuevoEstado){
estado = nuevoEstado;
}
void Auto :: setId(int nuevaId){
id = nuevaId;
}
#endif