-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViajes.h
57 lines (55 loc) · 1.37 KB
/
Viajes.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
#ifndef VIAJES_H
#define VIAJES_H
#include "Viaje.h"
//Alejandro Ocampo Ramirez 402690729
//Mariadna Rodriguez Oviedo 402630747
class Viajes {
private:
//se crea una coleccion de viajes
Viaje viajes[10];
int cantidad;
public:
Viajes(){
cantidad = 0;
}
//Llama a la funcion Viaje para establecer un viaje
void setViajes( float pKilometros, int pHoraDeLlegada, int pHoraDeSalida, string pLugarOrigen, string pLugarDestino) {
if (cantidad < 10) {
viajes[cantidad].setViaje(pKilometros, pHoraDeLlegada, pHoraDeSalida, pLugarOrigen, pLugarDestino);
}
}
string toString(int pViaje) {
stringstream s;
s << "Viaje: " << pViaje+1 << endl;
s << viajes[pViaje].toString();
return s.str();
}
int getCantidad() {
return cantidad;
}
float getKilometros(int pViaje) {
return viajes[pViaje].getKilometros();
}
float getCosto(int pViaje) {
return viajes[pViaje].getCosto();
}
float getCobro(int pViaje) {
return viajes[pViaje].getCobro();
}
float getGasolina(int pViaje) {
return viajes[pViaje].getGasolina();
}
string getDestino(int pViaje) {
return viajes[pViaje].getLugarDestino();
}
string getOrigen(int pViaje) {
return viajes[pViaje].getLugarOrigen();
}
float getGanancia(int pViaje) {
return viajes[pViaje].ganancia();
}
void setCantidad(int pCantidad) {
cantidad = pCantidad;
}
};
#endif