-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEncomendaRelampago.hpp
37 lines (27 loc) · 957 Bytes
/
EncomendaRelampago.hpp
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
#ifndef EncomendaRelampago_H
#define EncomendaRelampago_H
#include "Encomenda.hpp"
#include "Cliente.hpp"
class EncomendaRelampago: public Encomenda{
private:
double taxaAdicional;
public:
EncomendaRelampago(double peso, double custoKg, Cliente remetente, Cliente destinatario): Encomenda(peso, custoKg, remetente, destinatario) {
taxaAdicional = 0.25;
}
double getTaxaAdicional() { return taxaAdicional; }
double calculaPrecoTotal(){
double total = Encomenda::calculaPrecoTotal();
total += total * taxaAdicional;
return total;
}
void printEncomenda(){
Encomenda::printEncomenda();
std::cout << "[Encomenda Relâmpago]" << std::endl;
std::cout << " Peso: " << getPeso() << std::endl
<< " Custo por kg: " << getCustoKg() << std::endl
<< " Taxa adicional: " << getTaxaAdicional() << std::endl
<< " Custo total: " << getPrecoTotal() << std::endl;
}
};
#endif