Object-Oriented Programming (OOP) Exercise

This repository contains an exercise on Object-Oriented Programming (OOP) implemented in Python. The exercise focuses on practicing OOP concepts and principles to solve a specific problem.

Exercise Description 📝

The exercise involves creating an example of a Python class called "TV" that demonstrates concepts of object-oriented programming, such as encapsulation (using private attributes), accessor and mutator methods (getters and setters), and the use of exceptions for parameter validation.

Technologies Used 🛠️

The exercise utilizes the following technologies:

  • Python: A versatile programming language known for its simplicity and readability.

Usage ⚙️

To use the TV class, follow these steps:

  1. Instantiate an object of the TV class by providing the tamanho parameter.
  2. Use the various methods available to control the TV's volume, change channels, and turn the TV on or off.
  3. Retrieve the current channel and volume settings using the getter methods.

Instantiate the TV object:


const tv = new TV(42);

Increase the volume:


tv.aumentar_volume();

Change the channel:


tv.modificar_canal(5);

Get the current channel and volume:


const currentChannel = tv.get_canal();
const currentVolume = tv.get_volume();

Print the current channel and volume:


console.log(`Channel: ${currentChannel}`);
console.log(`Volume: ${currentVolume}`);

This will output:

 
Channel: 5
Volume: 51

Feel free to explore and experiment with the TV class to simulate the behavior of a television.

Contributing 🤝

Contributions are what make the open-source community a fantastic place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the project.
  2. Create a branch for your feature (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some amazing feature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

License 📄

This project is licensed under the MIT License. See the LICENSE file for details.

Contact 📬

Bruno Souza - bmsouza88@gmail.com

Project Link: https://github.com/BrunoSouza88/POO_Python-Exercise