Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class TV {
- int height;
- int width;
- int screen_size;
- int channel;
- int volume;
- bool power = false;
- public:
- TV(int _height, int _width, int _screen_size, int _channel, int _volume, bool _power) {
- height = _height;
- width = _width;
- screen_size = _screen_size;
- channel = _channel;
- volume = 0;
- power = 0;
- }
- void SetPower(int a) {
- if (a = 1) {
- power = true;
- cout << "TV is on" << power;
- }
- else if (a = 0) {
- power = false;
- cout << "TV is off" << endl;
- }
- else {
- cout << "ERROR 404 Command Not Found" << endl;
- }
- }
- void SetChannel(int b) {
- if (b = 1 & 2 & 3 & 4 & 5 & 6) {
- cout << "You are on channel" << b << endl;
- }
- else {
- cout << "Channel doesn't exist" << endl;
- }
- void SetVolume(int c) {
- if (c = 1) {
- volume++;
- cout << volume << endl;
- }
- else {
- volume--;
- cout << volume << endl;
- }
- }
- }
- }
- //class pupil
- //{
- //public:
- // int getage() {
- //
- // return age;
- //
- // }
- // void AgeSet(int _age) {
- // if (_age > 0 && _age < 100) {
- //
- // age = _age;
- // cout << "Nice" << endl;
- // }
- // else {
- //
- // cout << "Error, your age can't be more than 100 years." << endl;
- //
- // }
- // }
- // void weightset(int _weight) {
- //
- // if (_weight > 0 && weight < 150) {
- //
- // weight = _weight;
- // cout << "Nice" << endl;
- //
- // }
- // else {
- //
- // cout << "Sorry, no. Error" << endl;
- //
- // }
- //
- // }
- //
- //
- //private:
- // string name;
- // int age;
- // int weight;
- //};
- //class car {
- //
- // string name;
- // int speed;
- // int brake;
- // int year;
- // int currentspeed;
- // int boost;
- // int brakespeed;
- //public:
- // void setNameCar() {
- //
- // cin >> name;
- //
- // }
- // void getName() {
- //
- // cout << name << endl;
- //
- // }
- // void setSpeed(int _speed) {
- //
- // if (_speed > 0 && _speed < 400) {
- //
- // cout << " " << endl
- // }
- // else {
- // cout << "Error" << endl;
- // }
- // }
- // void setCurrentSpeed(int _currentspeed) {
- //
- //
- //
- // }
- //};
- int main(){
- /*int age;
- cin >> age;
- int weight;
- cin >> weight;
- pupil pupil2;
- pupil2.AgeSet(age);
- pupil2.weightset(weight);*/
- int a;
- cin >> a;
- int b;
- cin >> b;
- int c;
- cin >> c;
- TV TV1;
- TV1.SetPower(a);
- TV1.SetVolume(c);
- TV1.SetChannel(b);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement