#include<iostream>
using namespace std;
class USBDevice { long m_lID;
public:
USBDevice(long lID) : m_lID(lID) {}
long GetID() { return m_lID; }
};
class NetworkDevice { long m_lID;
public:
NetworkDevice(long lID) : m_lID(lID) {}
long GetID() { return m_lID; }
};
class WirelessAdaptor : public USBDevice, public NetworkDevice {
public:
WirelessAdaptor(long lUSBID, long lNetworkID)
: USBDevice(lUSBID), NetworkDevice(lNetworkID) {}
};
int main() {
int lUSBID, lNetworkID;
cin >> lUSBID >> lNetworkID;
WirelessAdaptor c54G(lUSBID, lNetworkID);
cout<<c54G.USBDevice::GetID();
cout<<":";
cout<<c54G.NetworkDevice::GetID();
return 0;
}
Thanks
Happy Programming !
using namespace std;
class USBDevice { long m_lID;
public:
USBDevice(long lID) : m_lID(lID) {}
long GetID() { return m_lID; }
};
class NetworkDevice { long m_lID;
public:
NetworkDevice(long lID) : m_lID(lID) {}
long GetID() { return m_lID; }
};
class WirelessAdaptor : public USBDevice, public NetworkDevice {
public:
WirelessAdaptor(long lUSBID, long lNetworkID)
: USBDevice(lUSBID), NetworkDevice(lNetworkID) {}
};
int main() {
int lUSBID, lNetworkID;
cin >> lUSBID >> lNetworkID;
WirelessAdaptor c54G(lUSBID, lNetworkID);
cout<<c54G.USBDevice::GetID();
cout<<":";
cout<<c54G.NetworkDevice::GetID();
return 0;
}
Thanks
Happy Programming !
No comments:
Post a Comment