Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class Device{
- protected:
- bool PoweredOn;
- string DeviceID;
- string Manufacturer;
- public:
- Device(): PoweredOn(0), DeviceID("M1906F9SH"), Manufacturer("KONCAR"){}
- Device(bool x, string ID, string Man): PoweredOn(x), DeviceID(ID), Manufacturer(Man){}
- void TurnON_OFF(bool x){
- PoweredOn = x;
- }
- };
- class USBDevice: public virtual Device{
- protected:
- bool Connected;
- string USBStandard;
- public:
- USBDevice(): Connected(0), USBStandard("2.0"), Device(0, "M1906F9SH", "KONCAR"){}
- USBDevice(bool spojen1, string stand1, bool stanje1, string id1, string proiz1): Connected(spojen1), USBStandard(stand1), Device(stanje1, id1, proiz1){}
- void virtual ConDisc(bool spoji1){
- Connected = spoji1;
- }
- bool getStatusUSB(){
- return Connected;
- }
- };
- class NetworkDevice: public virtual Device{
- protected:
- bool Connected;
- string NetworkStandard;
- public:
- NetworkDevice(): Connected(0), NetworkStandard("IEEE"), Device(0, "1C", "LG"){}
- NetworkDevice(bool spojen2, string stand2, bool stanje2, string id2, string proiz2): Connected(spojen2), NetworkStandard(stand2), Device(stanje2, id2, proiz2){}
- void virtual ConDisc(bool spoji2){
- Connected = spoji2;
- }
- bool getStatusNET(){
- return Connected;
- }
- };
- class WirelessAdapter: public USBDevice, public NetworkDevice{
- private:
- int No_ofAntennas;
- float Gain;
- public:
- WirelessAdapter(): No_ofAntennas(0), Gain(2.3), Device(1, "7A", "Apple"){}
- WirelessAdapter(int brA, float power, bool stanje, string id, string proiz): No_ofAntennas(brA), Gain(power), Device(stanje, id, proiz){}
- void ConDisc(){
- bool spoji1, spoji2;
- cout << "Spojiti USB uredaj?" << endl;
- cin >> spoji1;
- cout << "Spojiti NET uredaj?" << endl;
- cin >> spoji2;
- USBDevice::ConDisc(spoji1);
- NetworkDevice::ConDisc(spoji2);
- }
- void Status(){
- if(USBDevice::getStatusUSB() == 1){
- cout << "USB je spojen!" << endl;
- }
- if(NetworkDevice::getStatusNET() == 1){
- cout << "NET je spojen!" << endl;
- }
- }
- };
- int main(){
- int broj, status1, status2, on_off;
- float snaga;
- bool stanje;
- string id, proiz;
- cout << "Unesite broj antena: " << endl;
- cin >> broj;
- cout << "Unesite gain: " << endl;
- cin >> snaga;
- cout << "Unesite stanje: " << endl;
- cin >> stanje;
- cout << "Unesite idnetifikacijski broj: " << endl;
- cin >> id;
- cout << "Unesite proizvodjaca: " << endl;
- cin >> proiz;
- WirelessAdapter Adapter(broj, snaga, stanje, id, proiz);
- Adapter.ConDisc();
- Adapter.Status();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement