-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseguro.h
67 lines (57 loc) · 1.53 KB
/
seguro.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
#ifndef SEGURO_H
#define SEGURO_H
#include <string.h>
#include <sstream>
using namespace std;
class Seguro{
private:
int id;
float deducible;
float sumaAsegurada;
double costo;
float respCiv;
public:
Seguro();
Seguro(float d,float s,double c ,float r);
Seguro( Seguro &s);
int getId();
float getDeducible();
float getSumaAsegurada();
double getCosto();
float getRespCiv();
string toString();
void setId(int newId);
};
Seguro :: Seguro(): deducible(0.0),sumaAsegurada(0.0),costo(0.0),respCiv(0.0){}
Seguro :: Seguro(float d,float s,double c ,float r): deducible(d),sumaAsegurada(s),costo(c),respCiv(r){}
Seguro:: Seguro(Seguro &s): deducible(s.deducible),sumaAsegurada(s.sumaAsegurada),costo(s.costo),respCiv(s.respCiv){}
int Seguro :: getId(){
return id;
}
float Seguro :: getDeducible(){
return deducible;
}
float Seguro :: getSumaAsegurada(){
return sumaAsegurada;
}
double Seguro :: getCosto(){
return costo;
}
float Seguro :: getRespCiv(){
return respCiv;
}
void Seguro :: setId(int newId){
id = newId;
}
string Seguro :: toString(){
stringstream aux;
aux << "-----------------------------------"<<endl;
aux << "------------Seguro#"<<id<<"-----------------------"<<endl;
aux<<"--------------------------------------"<<endl;
aux<<"Deducible: "<<deducible<<"\n";
aux<<"Suma Asegurada: "<<sumaAsegurada<<"\n";
aux<<"Costo: "<<costo<<"\n";
aux<<"Responsabilidad civil: "<<respCiv<<"\n";
return aux.str();
}
#endif