this is my basic code and comments on what will/should go on..
Code:
class Phone
{
public:
void dial(int* number)
{ cout << "Dialing " << number << "...\n"; }
virtual void mute()
{ cout << "Phone::mute\n"; }
};
class Pod
{
public:
void Play(char* song)
{ cout << "Pod is Playing" << song << "....\n: }
virtual void mute()
{ cout << "Pod::mute\n"; }
};
class PodPhone: public Phone, public Pod
{
public:
// class inherits all
void Shutdown()
{ cout << "PodPhone user interaction has shutdown PodPhone" << endl; }
};
int main()
{
int choice;
cout <<"Press 1 to Dial Phone"<<endl;
cout <<"Press 2 to Mute/UnMute Phone"<<endl;
cout <<"Press 3 to Play Pod"<<endl;
cout <<"Press 4 to Mute/UnMute Pod"<<endl;
cout <<"Press 5 to ShutDown PodPhone"<<endl;
cin >> choice;
while (choice <6)
{
switch (choice)
{
case 1:
//Phone Dial number displayed
break;
case 2:
//Virtual Phone Mute/Unmute
break;
case 3:
//Play Pod Song Title displayed
break;
case 4:
//Virtual Pod Mute/Unmute
break;
case 5:
//PodPhone Shutdown
break;
default:
cout << "Incorrect entry - Please try again" <<"\n";
cout << "Re-enter a # between 1 and 5 ";
cin >> choice;
} //end switch
} // end while loop
return 0;
}
I can't use any global variables.. but I'm sure I can get to that later.. if they're public now I can always set them to the correct class via private or protected class. I will have to implement Virtual functions for Mute