añadido parte2
This commit is contained in:
31
parte2/include/Fecha.h
Normal file
31
parte2/include/Fecha.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef FECHA_H
|
||||
#define FECHA_H
|
||||
|
||||
#include <iostream> //cin, cout
|
||||
|
||||
using namespace std;
|
||||
//SI FALTA ALGUN METODO O FUNCION A<>ADIRLO...
|
||||
class Fecha {
|
||||
int dia;
|
||||
int mes, anio;
|
||||
public:
|
||||
Fecha(const int &dia, const int &m, const int &anio);
|
||||
//virtual ~Fecha(); //NO HACE FALTA
|
||||
//Fecha(const Fecha &f); //NO HACE FALTA: EL QUE GENERA EL COMPILADOR FUNCIONA BIEN YA QUE NO HAY PUNTEROS
|
||||
int getDia() const { return dia; }
|
||||
int getMes() const { return this->mes; }
|
||||
int getAnio() const { return this->anio; }
|
||||
void setFecha(const int &dia, const int &mes, const int &a);
|
||||
void ver() const;
|
||||
bool bisiesto() const;
|
||||
Fecha operator++(); //++f
|
||||
Fecha operator++(int i); //f++
|
||||
Fecha operator+(const int &i) const; //f+5
|
||||
|
||||
friend Fecha operator+(const int &i, const Fecha &f); //const por seguridad y & por velocidad
|
||||
friend ostream& operator<<(ostream& os, const Fecha& f);
|
||||
};
|
||||
|
||||
Fecha operator+(const int &i, const Fecha &f); //const por seguridad y & por velocidad
|
||||
|
||||
#endif // FECHA_H
|
||||
Reference in New Issue
Block a user