Está en la página 1de 2

//////////////////////////////////////////////////////////////////////////////

// Archivo : tiempo.h
// Fecha : 26/04/2020
// Descripción : Define tiempo
//////////////////////////////////////////////////////////////////////////////

#include <iostream>
#include <string>
using namespace std;

class Tiempo
{
private:
int hora;
int minuto;
int segundo;

public:
Tiempo();
~Tiempo();

int getHora();
void setHora(int h);
int getMinuto();
void setMinuto(int m);
int getSegundo();
void setSegundo(int s);

void inicio();
void ingreso();
void mostrarHora();
};

//////////////////////////////////////////////////////////////////////////////
// Archivo : tiempo.cpp
// Fecha : 26/04/2020
// Descripción : programa que asigna tiempo
//////////////////////////////////////////////////////////////////////////////

#include "tiempo.h"

int Tiempo::getHora()
{
return hora;
}
void Tiempo::setHora(int h)
{
hora = h;
}
int Tiempo::getMinuto()
{
return minuto;
}
void Tiempo::setMinuto(int m)
{
minuto = m;
}
int Tiempo::getSegundo()
{
return segundo;
}
void Tiempo::setSegundo(int s)
{
segundo = s;
}

void Tiempo::inicio()
{
this -> hora = 0;
this -> minuto = 0;
this -> segundo = 0;
}
void Tiempo::ingreso()
{
system("cls");
cout << "===INGRESE LA HORA:===\t " << endl;
cout << "Ingresar Hora\t: ";
cin >> hora;
cout << "Ingresar Minuto\t: ";
cin >> minuto;
cout << "Ingresar Segundo\t: ";
cin >> segundo;
cout << "===FIN INGRESO DE HORA===\t: " << endl;
system("pause");
}
void Tiempo::mostrarHora()
{
cout << hora << ":" << minuto << ":" << segundo << endl;
}
Tiempo::Tiempo()
{
this->hora = 0;
this->minuto = 0;
this->segundo = 0;
}
Tiempo::~Tiempo()
{
}

También podría gustarte