-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPasajero.cpp
More file actions
35 lines (25 loc) · 767 Bytes
/
Pasajero.cpp
File metadata and controls
35 lines (25 loc) · 767 Bytes
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
#include "Pasajero.h"
#include <stdlib.h>
#define Dinero 500
Pasajero::Pasajero(int parada_final, int parada_inicial, string nro_boleto, bool discapacidad) : nro_boleto(nro_boleto)
{
dinero = Dinero;
this->parada_inicial = parada_inicial;
this->discapacidad = discapacidad;
peso = 65;
this->parada_final = parada_final;
}
Pasajero::~Pasajero() {};
void Pasajero::Pagar(float monto)
{
if (dinero > monto)
dinero = dinero - monto;
else
throw new exception("El pasajero no posee el dinero suficiente.");
}
ostream& Pasajero::operator<<(ostream& os)
{
os << "Parada inicial: " << parada_inicial << endl;
os << "Parada final: " << parada_final << endl << "Numero de Boleto: " << nro_boleto << endl;
return os;
}