TAHMID37

OOP_TEAM_PROJEXT

Oct 21st, 2021
728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 19.04 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3. #include <typeinfo>
  4. #include <set>
  5. #include <iterator>
  6. using namespace std;
  7. #include <process.h>
  8. #include <windows.h>
  9.  
  10. const int LEN = 32;
  11. const int MAXEM = 1000;
  12.  
  13. enum computer_type {tgraphics, tprocessor,tmotherboard,tpowersupply,tmonitor,tram,tharddisk,tssd};
  14.  
  15. int total=0;
  16.  
  17. multiset<pair<int,int>>st;
  18.  
  19. class computer
  20. {
  21.  
  22. private:
  23.     char p_name[LEN];
  24.     int p_quantity;
  25.     int p_price;
  26.     static int n;
  27.     static computer* arrap[];
  28. public:
  29.  
  30.     virtual void getdata()
  31.     {
  32.         cin.ignore(10, '\n');
  33.         cout << "Enter product name: ";
  34.         cin >> p_name;
  35.         cout << " Enter product quantity : ";
  36.         cin >> p_quantity;
  37.         cout << " Enter product Price : ";
  38.         cin >> p_price;
  39.  
  40.     }
  41.     virtual void putdata()
  42.     {
  43.         cout << "\n Product Name: " << p_name;
  44.         cout << "\n Product quantity: " << p_quantity;
  45.         cout << "\n Product Price: " << p_price;
  46.     }
  47.     virtual computer_type get_type();
  48.     static void add();
  49.     static void read();
  50.     static void write();
  51.     static void display();
  52.     static void display_graphics();
  53.     static void display_processor();
  54.     static void display_motherboard();
  55.     static void display_powersupply();
  56.     static void display_ram();
  57.     static void display_ssd();
  58.     static void display_moniter();
  59.     static void display_harddisk();
  60.     static void modify_price(int index,int n_price);
  61.     static int calc(int index,int quantity);
  62.     static void print_item();
  63.  
  64. };
  65.  
  66. int computer::n;
  67.  
  68. computer* computer::arrap[MAXEM];
  69.  
  70. class graphics : public computer
  71. {
  72.  
  73.  private:
  74.     int memory_gb;
  75.  public:
  76.  
  77.     void getdata()
  78.     {
  79.         computer::getdata();
  80.         cout << "Enter memory of graphics : ";
  81.         cin >> memory_gb;
  82.     }
  83.     void putdata()
  84.     {
  85.         computer::putdata();
  86.         cout << "\n memory: " << memory_gb;
  87.     }
  88. };
  89.  
  90.  
  91. class processor : public computer
  92. {
  93. private:
  94.     int core;
  95.     int clock_speed;
  96.  
  97. public:
  98.     void getdata()
  99.     {
  100.         computer::getdata();
  101.         cout <<  "Enter core : ";
  102.         cin >> core;
  103.         cout <<  "Enter clock_speed : ";
  104.         cin >> clock_speed;
  105.  
  106.     }
  107.     void putdata()
  108.     {
  109.         computer::putdata();
  110.         cout << "\nNumber of core: " << core;
  111.         cout << "\n Clock_Speed: " << clock_speed;
  112.         cout<<endl;
  113.     }
  114. };
  115.  
  116. class motherboard:public computer{
  117.  
  118.    private:
  119.  
  120.    public:
  121.  
  122.     void getdata()
  123.     {
  124.         computer::getdata();
  125.  
  126.     }
  127.     void putdata()
  128.     {
  129.         computer::putdata();
  130.  
  131.     }
  132.  
  133. };
  134.  
  135. class ram:public computer{
  136.  
  137.    private:
  138.  
  139.    public:
  140.  
  141.     void getdata()
  142.     {
  143.         computer::getdata();
  144.  
  145.     }
  146.     void putdata()
  147.     {
  148.         computer::putdata();
  149.  
  150.     }
  151.  
  152. };
  153.  
  154. class powersupply:public computer{
  155.  
  156.    private:
  157.  
  158.    public:
  159.  
  160.     void getdata()
  161.     {
  162.         computer::getdata();
  163.  
  164.     }
  165.     void putdata()
  166.     {
  167.         computer::putdata();
  168.  
  169.     }
  170.  
  171. };
  172. class harddisk:public computer{
  173.  
  174.    private:
  175.  
  176.    public:
  177.  
  178.     void getdata()
  179.     {
  180.         computer::getdata();
  181.  
  182.     }
  183.     void putdata()
  184.     {
  185.         computer::putdata();
  186.  
  187.     }
  188.  
  189. };
  190. class ssd:public computer{
  191.  
  192.    private:
  193.  
  194.    public:
  195.  
  196.     void getdata()
  197.     {
  198.         computer::getdata();
  199.  
  200.     }
  201.     void putdata()
  202.     {
  203.         computer::putdata();
  204.  
  205.     }
  206.  
  207. };
  208.  
  209.  
  210. class moniter:public computer{
  211.  
  212.    private:
  213.  
  214.    public:
  215.  
  216.     void getdata()
  217.     {
  218.         computer::getdata();
  219.  
  220.     }
  221.     void putdata()
  222.     {
  223.         computer::putdata();
  224.  
  225.     }
  226.  
  227. };
  228.  
  229.  
  230. void computer::add()
  231. {
  232.     char ch;
  233.     cout <<"'1' to add a Graphics_Card"
  234.          "\n'2' to add a Processor"
  235.          "\n'3' to add a Motherboard"
  236.          "\n'4' to add a Power_supply"
  237.          "\n'5' to add a Ram"
  238.          "\n'6' to add a Harddisk"
  239.          "\n'7' to add a SSD"
  240.          "\n'8' to add a Moniter"
  241.          "\nEnter selection: ";
  242.     cin >> ch;
  243.     switch(ch)
  244.     {
  245.  
  246.     case '1':
  247.         arrap[n] = new graphics;
  248.         break;
  249.     case '2':
  250.         arrap[n] = new processor;
  251.         break;
  252.     case '3':
  253.         arrap[n]= new motherboard;
  254.         break;
  255.     case '4':
  256.         arrap[n]= new powersupply;
  257.         break;
  258.     case '5':
  259.         arrap[n]= new ram;
  260.         break;
  261.     case '6':
  262.         arrap[n]= new harddisk;
  263.         break;
  264.     case '7':
  265.         arrap[n]= new ssd;
  266.         break;
  267.     case '8':
  268.         arrap[n]= new moniter;
  269.         break;
  270.     default:
  271.         cout << "\nUnknown type\n";
  272.         return;
  273.     }
  274.     arrap[n++]->getdata();
  275. }
  276.  
  277. void computer::display()
  278. {
  279.     for(int j=0; j<n; j++)
  280.     {
  281.         cout << (j+1);
  282.         switch( arrap[j]->get_type() )         {
  283.         case tgraphics:
  284.             cout << ". Type: Graphics ";
  285.             break;
  286.         case tprocessor:
  287.             cout << ". Type: Processor ";
  288.             break;
  289.         case tmotherboard:
  290.             cout<< " . Type: Motherboard";
  291.             break;
  292.         case tpowersupply:
  293.             cout<< " . Type: Power_Supply";
  294.             break;
  295.         case tram:
  296.             cout<< " . Type: Ram";
  297.             break;
  298.         case tharddisk:
  299.             cout<< " . Type: Hard_Disk";
  300.             break;
  301.         case tssd:
  302.             cout<< " . Type: SSD";
  303.             break;
  304.         case tmonitor:
  305.             cout<< " . Type: Moniter";
  306.             break;
  307.         default:
  308.             cout << ". Unknown type";
  309.         }
  310.         arrap[j]->putdata();
  311.         cout << endl;
  312.     }
  313. }
  314.  
  315. void computer::display_graphics()
  316. {
  317.     for(int j=0; j<n; j++)
  318.     {
  319.         if(arrap[j]->get_type()==tgraphics){
  320.             cout<<(j+1)<<" ";
  321.             arrap[j]->putdata();
  322.             cout << endl;
  323.         }
  324.         else
  325.             continue;
  326.     }
  327.  
  328. }
  329. void computer::display_processor()
  330. {
  331.     for(int j=0; j<n; j++)
  332.     {
  333.         if(arrap[j]->get_type()==tprocessor){
  334.             cout<<(j+1)<<" ";
  335.             arrap[j]->putdata();
  336.             cout << endl;
  337.         }
  338.         else
  339.             continue;
  340.     }
  341.  
  342. }
  343. void computer::display_motherboard()
  344. {
  345.     for(int j=0; j<n; j++)
  346.     {
  347.         if(arrap[j]->get_type()==tmotherboard){
  348.             cout<<(j+1)<<" ";
  349.             arrap[j]->putdata();
  350.             cout << endl;
  351.         }
  352.         else
  353.             continue;
  354.     }
  355.  
  356. }
  357.  
  358.  
  359. void computer::display_powersupply()
  360. {
  361.     for(int j=0; j<n; j++)
  362.     {
  363.         if(arrap[j]->get_type()==tpowersupply){
  364.             cout<<(j+1)<<" ";
  365.             arrap[j]->putdata();
  366.             cout << endl;
  367.         }
  368.         else
  369.             continue;
  370.     }
  371.  
  372. }
  373.  
  374.  
  375. void computer::display_ram()
  376. {
  377.     for(int j=0; j<n; j++)
  378.     {
  379.         if(arrap[j]->get_type()==tram){
  380.             cout<<(j+1)<<" ";
  381.             arrap[j]->putdata();
  382.             cout << endl;
  383.         }
  384.         else
  385.             continue;
  386.     }
  387.  
  388. }
  389.  
  390.  
  391. void computer::display_ssd()
  392. {
  393.     for(int j=0; j<n; j++)
  394.     {
  395.         if(arrap[j]->get_type()==tssd){
  396.             cout<<(j+1)<<" ";
  397.             arrap[j]->putdata();
  398.             cout << endl;
  399.         }
  400.         else
  401.             continue;
  402.     }
  403.  
  404. }
  405.  
  406.  
  407. void computer::display_harddisk()
  408. {
  409.     for(int j=0; j<n; j++)
  410.     {
  411.         if(arrap[j]->get_type()==tharddisk){
  412.             cout<<(j+1)<<" ";
  413.             arrap[j]->putdata();
  414.             cout << endl;
  415.         }
  416.         else
  417.             continue;
  418.     }
  419.  
  420. }
  421.  
  422.  
  423. void computer::display_moniter()
  424. {
  425.     for(int j=0; j<n; j++)
  426.     {
  427.         if(arrap[j]->get_type()==tmonitor){
  428.             cout<<(j+1)<<" ";
  429.             arrap[j]->putdata();
  430.             cout << endl;
  431.         }
  432.         else
  433.             continue;
  434.     }
  435.  
  436. }
  437.  
  438.  
  439.  
  440. computer_type computer::get_type()
  441. {
  442.     if( typeid(*this) == typeid(graphics) )
  443.         return tgraphics;
  444.     else if( typeid(*this)==typeid(processor) )
  445.         return tprocessor;
  446.     else if( typeid(*this)==typeid(motherboard) )
  447.         return tmotherboard;
  448.     else if( typeid(*this)==typeid(powersupply) )
  449.         return tpowersupply;
  450.     else if( typeid(*this)==typeid(harddisk) )
  451.         return tharddisk;
  452.     else if( typeid(*this)==typeid(ssd) )
  453.         return tssd;
  454.     else if( typeid(*this)==typeid(ram) )
  455.         return tram;
  456.     else if( typeid(*this)==typeid(moniter) )
  457.         return tmonitor;
  458.     else
  459.     {
  460.         cerr << "\nBad type";
  461.         exit(1);
  462.     }
  463.  
  464. }
  465.  
  466. void computer::write()
  467. {
  468.     int size;
  469.     cout << "Writing " << n << " Components.\n";
  470.     ofstream ouf;
  471.     computer_type etype;
  472.  
  473.     ouf.open("Comp.DAT", ios::trunc | ios::binary);
  474.     if(!ouf)
  475.     {
  476.         cout << "\nCan’t open file\n";
  477.         return;
  478.     }
  479.  
  480.     for(int j=0; j<n; j++)     {
  481.  
  482.         etype = arrap[j]->get_type();
  483.  
  484.         ouf.write( (char*)&etype, sizeof(etype) );
  485.         switch(etype)
  486.         {
  487.         case tgraphics:
  488.             size=sizeof(graphics);
  489.             break;
  490.         case tprocessor:
  491.             size=sizeof(processor);
  492.             break;
  493.         case tmotherboard:
  494.             size=sizeof(motherboard);
  495.             break;
  496.         case tpowersupply:
  497.             size=sizeof(powersupply);
  498.             break;
  499.          case tharddisk:
  500.             size=sizeof(harddisk);
  501.             break;
  502.         case tram:
  503.             size=sizeof(ram);
  504.             break;
  505.         case tssd:
  506.             size=sizeof(ssd);
  507.             break;
  508.         case tmonitor:
  509.             size=sizeof(moniter);
  510.             break;
  511.         }
  512.         ouf.write( (char*)(arrap[j]), size );
  513.         if(!ouf)
  514.         {
  515.             cout << "\nCan’t write to file\n";
  516.             return;
  517.         }
  518.     }
  519. }
  520.  
  521.  
  522.  
  523.  
  524. void computer::read()
  525. {
  526.     int size;
  527.     computer_type etype;
  528.     ifstream inf;
  529.  
  530.     inf.open("Comp.DAT", ios::binary);
  531.     if(!inf)
  532.     {
  533.         cout << "\nCan’t open file\n";
  534.         return;
  535.     }
  536.  
  537.     n = 0;
  538.  
  539.     while(true)
  540.     {
  541.         inf.read( (char*)&etype, sizeof(etype) );
  542.         if( inf.eof() )
  543.             break;
  544.         if(!inf)
  545.         {
  546.             cout << "\nCan’t read type from file\n";
  547.             return;
  548.         }
  549.         switch(etype)
  550.         {
  551.  
  552.         case tgraphics:
  553.             arrap[n] = new graphics;
  554.             size=sizeof(graphics);
  555.             break;
  556.         case tprocessor:
  557.             arrap[n] = new processor;
  558.             size=sizeof(processor);
  559.             break;
  560.         case tmotherboard:
  561.             arrap[n] = new motherboard;
  562.             size=sizeof(motherboard);
  563.             break;
  564.         case tpowersupply:
  565.             arrap[n] = new powersupply;
  566.             size=sizeof(powersupply);
  567.             break;
  568.         case tharddisk:
  569.             arrap[n] = new harddisk;
  570.             size=sizeof(harddisk);
  571.             break;
  572.         case tram:
  573.             arrap[n] = new ram;
  574.             size=sizeof(ram);
  575.             break;
  576.         case tssd:
  577.             arrap[n] = new ssd;
  578.             size=sizeof(ssd);
  579.             break;
  580.         case tmonitor:
  581.             arrap[n] = new moniter;
  582.             size=sizeof(moniter);
  583.             break;
  584.         default:
  585.             cout << "\nUnknown type in file\n";
  586.             return;
  587.         }
  588.         inf.read( (char*)arrap[n], size );
  589.         if(!inf)         {
  590.             cout << "\nCan’t read data from file\n";
  591.             return;
  592.         }
  593.         n++;
  594.     }
  595.     cout << "Reading " << n << " Components\n";
  596. }
  597.  
  598. void computer::modify_price(int index ,int price)
  599. {
  600.      system("cls");
  601.      arrap[index-1]->p_price=price;
  602.      computer::write();
  603.  
  604. }
  605.  
  606. int computer::calc(int index,int quanity)
  607. {
  608.     int tot=0;
  609.  
  610.      if(arrap[index-1]->p_quantity >= quanity)
  611.     {
  612.  
  613.       tot=(arrap[index-1]->p_price )*quanity;
  614.       arrap[index-1]->p_quantity -=quanity;
  615.     }
  616.  
  617.     return tot;
  618. }
  619.  
  620. int select_product_for_buy(int index,int quantity)
  621. {
  622.     st.insert({index,quantity});
  623. }
  624.  
  625. void computer::print_item()
  626. {
  627.     cout<<"PRODUCT"<<" "<<"price"<<" "<<"quantity"<<endl;
  628.     int tot=0;
  629.  
  630.     for(auto x:st)
  631.     {
  632.         string name=arrap[x.first-1]->p_name;
  633.         int price=arrap[x.first-1]->p_price;
  634.         int quantity=x.second;
  635.         tot+=price*quantity;
  636.  
  637.         cout<<name<<"   "<<price<<"    "<<quantity<<endl;
  638.     }
  639.  
  640.     cout<<"Total money : "<<tot<<endl;
  641.  
  642.     st.clear();
  643. }
  644.  
  645.  
  646. int run()
  647. {
  648.     int x=1;
  649.  
  650.     int money=0;
  651.  
  652.     while(x!=0)
  653.     {
  654.        system("cls");
  655.        computer::display();
  656.        cout<<"Enter y/n to buy or exit"<<endl;
  657.        char ch;
  658.        cin>>ch;
  659.        if(ch=='n')
  660.        {
  661.            x=0;
  662.            break;
  663.        }
  664.        int a,b;
  665.        cout<<"Enter product index ";
  666.        cin>>a;
  667.        cout<<"Enter product quantity ";
  668.        cin>>b;
  669.  
  670.        int temp=computer::calc(a,b);
  671.  
  672.        if(temp)
  673.        {
  674.            st.insert({a,b});
  675.            money+=temp;
  676.        }
  677.        else
  678.        {
  679.            cout<<"Quantity is not correct "<<endl;
  680.        }
  681.  
  682.     }
  683.  
  684.     computer::write();
  685.  
  686.     return money;
  687. }
  688.  
  689. namespace password{
  690.  
  691.      string cout="Manager37";
  692. }
  693.  
  694. class customer{
  695.  
  696.  private:
  697.      int pay=0;
  698.  
  699.  public:
  700.  
  701.    void show_all_products()
  702.    {
  703.        computer::display();
  704.    }
  705.  
  706.    void show_all_graphics_card()
  707.    {
  708.        computer::display_graphics();
  709.    }
  710.  
  711.  
  712.    void show_all_motherboard()
  713.    {
  714.        computer::display_motherboard();
  715.    }
  716.  
  717.  
  718.    void show_all_powersupply()
  719.    {
  720.        computer::display_powersupply();
  721.    }
  722.  
  723.    void show_all_processor()
  724.    {
  725.        computer::display_processor();
  726.    }
  727.  
  728.    void show_all_harddisk()
  729.    {
  730.        computer::display_harddisk();
  731.    }
  732.  
  733.    void show_all_ram()
  734.    {
  735.        computer::display_ram();
  736.    }
  737.  
  738.    void show_all_ssd()
  739.    {
  740.        computer::display_ssd();
  741.    }
  742.  
  743.     void show_all_monitor()
  744.    {
  745.        computer::display_moniter();
  746.    }
  747.  
  748.    void buy_items()
  749.    {
  750.        pay=run();
  751.    }
  752.  
  753.    class error{
  754.  
  755.      private:
  756.         int need;
  757.  
  758.      public:
  759.         error(int a):need(a){}
  760.  
  761.    };
  762.  
  763.    void buying_items()
  764.    {
  765.        computer::print_item();
  766.  
  767.        cout<<"please pay the amount to buy the products"<<endl;
  768.  
  769.        cout<<"ENTER AMOUNT : ";
  770.        int x;
  771.        cin>>x;
  772.  
  773.        if(x<pay)
  774.         throw error(pay-x);
  775.  
  776.        x-=pay;
  777.  
  778.        cout<<"Thank you sir, Your returned amount is : "<<x<<endl;
  779.  
  780.        pay=0;
  781.    }
  782.  
  783.  
  784. };
  785.  
  786. int main()
  787. {
  788.  
  789.      cout<<"Welcome to Computer management shop "<<endl;
  790.  
  791.      cout<<endl;
  792.  
  793.      cout<<"1. Customers "<<endl; cout<<endl;
  794.  
  795.      cout<<"2. Manager "<<endl; cout<<endl;
  796.  
  797.      cout<<"ENTER SELECTION : ";
  798.      char temp;
  799.      cin>>temp;
  800.  
  801.      if(temp=='1')
  802.      {
  803.        system("cls");
  804.  
  805.        computer::read();
  806.  
  807.        char ch;
  808.  
  809.        customer c;
  810.  
  811.  
  812.        while(true)
  813.        {
  814.         cout<<
  815.              "\n'1' -- display data for all Components"
  816.              "\n'2' -- display all graphics"
  817.              "\n'3' -- display all processor"
  818.              "\n'4' -- display all motherboard"
  819.              "\n'5' -- display all Power_Supply"
  820.              "\n'6' -- display all RAM  "
  821.              "\n'7' -- display all SSD"
  822.              "\n'8' -- display all Hard_Disk"
  823.              "\n'9' -- display all Moniter"
  824.              "\n'b' -- Buy products       "
  825.              "\n'x' -- exit"
  826.              "\nEnter selection: ";
  827.  
  828.              cin>>ch;
  829.  
  830.              system("cls");
  831.  
  832.              if(ch=='1')
  833.              {
  834.                  c.show_all_products();
  835.              }
  836.              else if(ch=='2')
  837.              {
  838.                  c.show_all_graphics_card();
  839.              }
  840.              else if(ch=='3')
  841.              {
  842.                  c.show_all_processor();
  843.              }
  844.              else if(ch=='4')
  845.              {
  846.                  c.show_all_motherboard();
  847.              }
  848.              else if(ch=='5')
  849.              {
  850.                  c.show_all_powersupply();
  851.              }
  852.              else if(ch=='6')
  853.              {
  854.                  c.show_all_ram();
  855.              }
  856.              else if(ch=='7')
  857.              {
  858.                  c.show_all_ssd();
  859.              }
  860.              else if(ch=='8')
  861.              {
  862.                  c.show_all_harddisk();
  863.              }
  864.              else if(ch=='9')
  865.              {
  866.                  c.show_all_monitor();
  867.              }
  868.              else if(ch=='b')
  869.              {
  870.                  try
  871.                  {
  872.                       c.buy_items();
  873.                       system("cls");
  874.                       c.buying_items();
  875.  
  876.                  }
  877.                  catch(customer::error a)
  878.                  {
  879.                      cout<<"Less amount than total price"<<endl;
  880.                      exit(1);
  881.                  }
  882.              }
  883.              else if(ch=='x')
  884.                 exit(1);
  885.              else
  886.              {
  887.                  cout<<"Unknow command"<<endl;
  888.              }
  889.  
  890.  
  891.        }
  892.  
  893.  
  894.      }
  895.      else if(temp=='2')
  896.      {
  897.          cout<<"Enter Password : ";
  898.          string s;
  899.          cin>>s;
  900.          if(s!=password::cout){
  901.  
  902.              cout<<"Oops incorrect password"<<endl;
  903.              exit(1);
  904.  
  905.          }
  906.  
  907.  
  908.     char ch;
  909.     system("cls");
  910.     computer::read();
  911.  
  912.     while(true)
  913.     {
  914.  
  915.         cout <<"'a' -- add data for any Components"
  916.              "\n'1' -- display data for all Components"
  917.              "\n'2' -- display all graphics"
  918.              "\n'3' -- display all processor"
  919.              "\n'4' -- display all motherboard"
  920.              "\n'5' -- display all Power_Supply"
  921.              "\n'6' -- display all RAM  "
  922.              "\n'7' -- display all SSD"
  923.              "\n'8' -- display all Hard_Disk"
  924.              "\n'9' -- display all Moniter"
  925.              "\n'w' -- Write              "
  926.              "\n'm' -- modify price of a product"
  927.              "\n'x' -- exit"
  928.              "\nEnter selection: ";
  929.         cin >> ch;
  930.         system("cls");
  931.         switch(ch)
  932.         {
  933.         case 'a':
  934.             computer::add();
  935.             computer::write();
  936.             break;
  937.         case '1':
  938.             computer::display();
  939.             break;
  940.         case '2':
  941.             computer::display_graphics();
  942.             break;
  943.         case '3':
  944.             computer::display_processor();
  945.             break;
  946.         case '4':
  947.             computer::display_motherboard();
  948.             break;
  949.         case '5':
  950.             computer::display_powersupply();
  951.             break;
  952.         case '6':
  953.             computer::display_ram();
  954.             break;
  955.         case '7':
  956.             computer::display_ssd();
  957.             break;
  958.         case '8':
  959.             computer::display_harddisk();
  960.             break;
  961.         case '9':
  962.             computer::display_moniter();
  963.             break;
  964.          case 'w':
  965.             computer::write();
  966.             break;
  967.         case 'm':
  968.             int a,b;
  969.             computer::display();
  970.             cout<<"THE INDEX OF THE PRODUCT : ";
  971.             cin>>a;
  972.             cout<<"THE NEW PRICE OF THE PRODUCT : ";
  973.             cin>>b;
  974.             computer::modify_price(a,b);
  975.             break;
  976.         case 'x':
  977.             exit(0);
  978.         default:
  979.             cout << "\nUnknown command";
  980.         }
  981.     }
  982.  
  983.  
  984.  
  985.      }
  986.  
  987.  
  988.     return 0;
  989. }
  990.  
  991.  
Advertisement
Add Comment
Please, Sign In to add comment