Answer to Question #197239 in C++ for Muhammad Umair

Question #197239

Create a class TV having the following attributes and functions.(C++)

1.      Volume (int)

2.      currentChannel (int)

Create another class called Remote Control having the following functions

1.      volumeUp()

2.      volumeDown()

3.      ChannelUp()

4.      ChannelDown()

Make the remote class friend of TV class.


1
Expert's answer
2021-05-23T08:05:18-0400
class TV {
  int Volume;
  int currentChannel;
  TV(int Volume, int currentChannel) {
    this->Volume = Volume;
    this->currentChannel = currentChannel;  
  }
  friend class RemoteControl;
};
class RemoteControl {
  void volumeUp();
  void volumeDown();
  void ChannelUp();
  void ChannelDown();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog