Last active
November 1, 2016 23:16
-
-
Save graifman/789b561b1e511693d8d8d899ae66f346 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #include <string> | |
| using std::string; | |
| class TV { // Construtor da classe TV | |
| private: // Declaração dos atributos privados da classe | |
| string model; // Modelo | |
| bool state; // Estado do aparelho (ligado ou desligado) | |
| unsigned int channel; // Canais | |
| unsigned int snd_volume; // Volume do som | |
| public: // Declaração dos atributos privados da classe | |
| void power_toggle(); // Alternar entre ligado e desligado | |
| string get_model(); // Obter o modelo | |
| bool is_on(); // Retorna se está ligado ou desligado | |
| unsigned int get_channel(); // Obter canal | |
| unsigned int get_snd_volume(); //Obter volume | |
| void set_channel(unsigned int v); // Definir canal | |
| void set_snd_volume(unsigned int v); // Definir volume | |
| void inc_channel(); // Incrementar o número do canal | |
| void inc_snd_volume(); // Aumentar o volume | |
| void dec_channel(); // Diminuir o número do canal | |
| void dec_snd_volume(); // Diminuir volume | |
| void dump(); // Retorna detalhes do funcionamento | |
| static const unsigned int MAX_SND_VOLUME; // Volume máximo | |
| static const unsigned int MAX_CHANNEL; // Número máximo do canal | |
| TV(string v_model); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment