-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from studas/lista06/ex04
Lista06/ex04
- Loading branch information
Showing
8 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "Radio.hpp" | ||
|
||
Radio::Radio(float estacao, bool amfm) { | ||
this->_isLigado = 0; | ||
this->_estacao = estacao; | ||
this->_amfm = amfm; | ||
} | ||
|
||
auto Radio::setarEstacao(float estacao) -> void { | ||
this->_estacao = estacao; | ||
} | ||
|
||
auto Radio::mudarAmFm(bool amfm) -> void { | ||
this->_amfm = amfm; | ||
} | ||
|
||
auto Radio::ligarDesligar(bool isLigado) -> void { | ||
this->_isLigado = isLigado; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
class Radio { | ||
private: | ||
bool _isLigado; | ||
float _estacao; | ||
bool _amfm; | ||
|
||
public: | ||
Radio(float estacao, bool amfm); | ||
auto setarEstacao(float estacao) -> void; | ||
auto mudarAmFm(bool amfm) -> void; | ||
auto ligarDesligar(bool isLigado) -> void; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "Radiorelogio.hpp" | ||
|
||
auto Radiorelogio::alarmeSintonizar(int hora, int minuto, int segundo , float estacao) -> void { | ||
Relogio::definirAlarme(hora, minuto, segundo); | ||
Radio::setarEstacao(estacao); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
#include "Radio.hpp" | ||
#include "Relogio.hpp" | ||
|
||
class Radiorelogio : public Radio, public Relogio { | ||
public: | ||
Radiorelogio(float estacao, bool amfm, int hora, int minuto, int segundo) : Radio(estacao, amfm), Relogio(hora, minuto, segundo) {} | ||
auto alarmeSintonizar(int hora, int minuto, int segundo , float estacao) -> void; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "Relogio.hpp" | ||
#include <iostream> | ||
|
||
auto Relogio::exibirHoras() -> void { | ||
std::cout << "Horario: " << this->_horas << ":" << this->_minutos << ":" << this->_segundos << "\n"; | ||
} | ||
|
||
auto Relogio::definirHoras(int horaDef, int minutoDef, int segundoDef) -> void { | ||
this->_horas = horaDef; | ||
this->_minutos = minutoDef; | ||
this->_segundos = segundoDef; | ||
} | ||
|
||
auto Relogio::definirAlarme(int horaAlarme, int minutoAlarme, int segundoAlarme) -> void { | ||
this->_horasAlarme = horaAlarme; | ||
this->_minutosAlarme = minutoAlarme; | ||
this->_segundosAlarme = segundoAlarme; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
class Relogio { | ||
protected: | ||
int _horas; | ||
int _minutos; | ||
int _segundos; | ||
int _horasAlarme; | ||
int _minutosAlarme; | ||
int _segundosAlarme; | ||
|
||
public: | ||
Relogio(int hora, int minuto, int segundo): _horas{ hora }, _minutos{ minuto }, _segundos{ segundo } {}; | ||
auto exibirHoras() -> void; | ||
auto definirHoras(int horaDef, int minutoDef, int segundoDef) -> void; | ||
auto definirAlarme(int horaAlarme, int minutoAlarme, int segundoAlarme) -> void; | ||
}; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "Relogio.hpp" | ||
#include "Radio.hpp" | ||
|
||
auto main() -> int { | ||
|
||
} |