Advertisement
Eriss69

1

Apr 9th, 2020
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 11.80 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdio.h>
  3. #include<cstdlib>
  4. #include<windows.h>
  5.  
  6.  
  7. #define PL 1
  8. #define ENG 2
  9. int    AskForLangugage();
  10. void   MenuPL();
  11. void   MenuEng();
  12. bool   DoYouWantEndProgram();
  13. int lang = 1;
  14. using namespace std;
  15. namespace menupl
  16. {
  17.     void internet(int a, int b);
  18.     void przegladarka(int a, int b);
  19.     void screen(int a);
  20.     void PowerButton(int a, int b);
  21. }
  22. namespace menueng
  23. {
  24.     void internet(int a, int b);
  25.     void przegladarka(int a, int b);
  26.     void screen(int a);
  27.     void PowerButton(int a, int b);
  28. }
  29.  
  30. int main()
  31. {
  32.     bool  bWork = true;
  33.     while (bWork)
  34.     {
  35.         lang = AskForLangugage();
  36.         if (lang == PL)
  37.         {
  38.             MenuPL();
  39.         }
  40.         else if (lang == ENG)
  41.         {
  42.             MenuEng();
  43.         }
  44.         else { cout << "Blad wyboru jezyka \n"; }
  45.         bWork = DoYouWantEndProgram();
  46.     }
  47.     return 0;
  48. }
  49. int AskForLangugage()
  50. {
  51.     string odp;
  52.     bool sprawdz = true;
  53.     do
  54.     {
  55.         system("cls");
  56.         cout << "Menu: " << endl;
  57.         cout << "[1] PL" << endl;
  58.         cout << "[2] ENG" << endl;
  59.         cout << "Prosze wybrac jezyk: "; cin >> odp;
  60.         if (odp == "1")
  61.         {
  62.             sprawdz = false;
  63.             return 1;
  64.         }
  65.         else if (odp == "2")
  66.         {
  67.             return 2;
  68.             sprawdz = false;
  69.         }
  70.         else if ((odp != "1") && (odp != "2"))
  71.         {
  72.             cout << "Masz podac liczbe nie znak " << endl;
  73.             system("pause");
  74.             sprawdz = true;
  75.  
  76.         }
  77.  
  78.     } while (sprawdz);
  79.  
  80.  
  81. }
  82. bool DoYouWantEndProgram()
  83. {
  84.  
  85.     return false;
  86. }
  87. void   MenuPL()
  88. {
  89.  
  90.     int menu, odp, odp1;
  91.     for (;;)
  92.     {
  93.         system("cls");
  94.         cout << "Menu polskie" << endl;
  95.         cout << endl << endl;
  96.         cout << "\t \t \t \t  Twoje Centrum pomocy Hello World , Wita!" << endl;
  97.         cout << "Jaki masz problem ? " << endl;
  98.         cout << "Spojrz na menu! I wybierz swoj problem " << endl;
  99.         cout << "[1] Problemy z internetem, lub brak internetu" << endl;
  100.         cout << "[2] Przegladarka nie chce sie wlaczyc" << endl;
  101.         cout << "[3] Pojawiajace sie artefakty na monitorze" << endl;
  102.         cout << "[4} Nie dzialajacy przycisk wylaczania Pc " << endl;
  103.         cout << "[5] Zakoncz Program" << endl;
  104.         cout << "[6]Wybierz ponownie jezyk/Select language again" << endl;
  105.         cout << " Wybierz z naszego menu: ";
  106.         cin >> menu;
  107.         switch (menu)
  108.         {
  109.         case 1:
  110.             cout << endl;
  111.             cout << " Wybrales opcje numer [1] Problemy z internetem, lub brak internetu, chetnie ci pomozemy " << endl << endl;
  112.             cout << "Sprawdz czy masz wlaczony router :)" << endl;
  113.             cout << "[1] Tak, mam wlaczony" << endl;
  114.             cout << "[2] Nie, nie jest wlaczony" << endl;
  115.             cout << "Wybierz : ";
  116.             cin >> odp;
  117.             cout << endl;
  118.             cout << "Czy problem znikl?  " << endl;
  119.             cout << "[1]Tak" << endl;
  120.             cout << "[2]Nie" << endl;
  121.             cout << "Wybierz ponownie: ";
  122.             cin >> odp1;
  123.  
  124.             menupl::internet(odp, odp1);
  125.  
  126.  
  127.             break;
  128.         case 2:
  129.             cout << endl;
  130.             cout << " Wybrales opcje numer [2] Przegladarka nie chce sie wlaczyc, chetnie ci pomozemy" << endl << endl;
  131.             cout << "Po pierwsze, zorientuj sie, gdzie lezy problem" << endl << endl;
  132.             cout << "Sprawdz czy w task manager nie masz wlaczonych kilka przegladarek! " << endl;
  133.             cout << "[1] Tak, jest wlaczonych kilka przegladarek " << endl;
  134.             cout << "[2] Nie, nie ma zadnych wlaczoncyh" << endl;
  135.             cout << "Powiedz jak wyglada sprawa: ";
  136.             cin >> odp;
  137.  
  138.             cout << endl;
  139.             cout << "Problem nadal wystepuje?: " << endl;
  140.             cout << "[1]Tak" << endl;
  141.             cout << "[2]Nie" << endl;
  142.             cout << "Wybierz : ";
  143.             cin >> odp1;
  144.  
  145.             menupl::przegladarka(odp, odp1);
  146.  
  147.             break;
  148.         case 3:
  149.             cout << endl;
  150.             cout << "Wybrales opcje numer [3] Pojawiajace sie artefakty na monitorze" << endl << endl;
  151.             cout << "Sprawdz swoja karte graficzna , czy problem lezy po jej stornie" << endl;
  152.             cout << "[1]Tak" << endl;
  153.             cout << "[2] Nie" << endl;
  154.             cout << "Wybierz prosze : ";
  155.             cin >> odp;
  156.  
  157.             menupl::screen(odp);
  158.  
  159.             break;
  160.         case 4:
  161.             cout << endl;
  162.             cout << "Wybrales opcje numer[4] Nie dzialajacy przycisk wylaczania Pc" << endl;
  163.             cout << "Sprawdz czy nie masz uszkodzonej obudowy od PC" << endl;
  164.             cout << "[1]Tak jest uszkodzona" << endl;
  165.             cout << "[2]Nie, nie jest uszkodzona" << endl;
  166.             cout << "wybierz :";
  167.             cin >> odp;
  168.  
  169.             cout << "Chcesz sam podalczyc kontrolki od przycisku POWER?" << endl;
  170.             cout << "[1]Tak" << endl;
  171.             cout << "[2]Nie" << endl;
  172.             cout << "Wybierz: ";
  173.             cin >> odp1;
  174.  
  175.             menupl::PowerButton(odp, odp1);
  176.  
  177.             break;
  178.         case 5:
  179.             cout << "Dziekujemy za skorzystanie z naszego programu! Mam Nadzieje, ze udalo nam ci sie pomoc :) " << endl;
  180.             exit(0);
  181.  
  182.             break;
  183.         case 6:
  184.             cout << "Chcesz wrocic do menu wyboru jezyka? /Do you want to return to the language selection menu?" << endl;
  185.             system("pause");
  186.             main();
  187.             break;
  188.  
  189.  
  190.         default:
  191.             cout << "Nie ma takiej opcji w menu!" << endl;
  192.             system("pause");
  193.             break;
  194.         }
  195.     }
  196.  
  197. }
  198. void   MenuEng()
  199. {
  200.  
  201.     cout << "Menu English" << endl;
  202.     int menu, odp, odp1;
  203.     for (;;)
  204.     {
  205.         system("cls");
  206.         cout << "Menu English   " << endl;
  207.         cout << endl << endl;
  208.         cout << "\t \t \t \t  Your Help Center MyPc , Welcom!" << endl;
  209.         cout << "What is your problem? " << endl;
  210.         cout << "Look at the menu! And choose your problem" << endl;
  211.         cout << "[1]Problems with the internet, or no internet " << endl;
  212.         cout << "[2] The browser won't turn on" << endl;
  213.         cout << "[3] Artifacts appearing on the monitor" << endl;
  214.         cout << "[4} Inactive Pc off button " << endl;
  215.         cout << "[5] End Program" << endl;
  216.         cout << "[6]Wybierz ponownie jezyk/Select language again" << endl;
  217.         cout << " choose from our menu: ";
  218.         cin >> menu;
  219.         switch (menu)
  220.         {
  221.         case 1:
  222.             cout << endl;
  223.             cout << " You have chosen options number [1] Problems with the internet, or no internet, we will be happy to help you " << endl << endl;
  224.             cout << "Check if your router is turned on :)" << endl;
  225.             cout << "[1] Yes, I have it turned on" << endl;
  226.             cout << "[2] No, it is not enabled" << endl;
  227.             cout << "Select : ";
  228.             cin >> odp;
  229.  
  230.             cout << "Is the problem gone?  " << endl;
  231.             cout << "[1]Yes" << endl;
  232.             cout << "[2]No" << endl;
  233.             cout << "Select again: ";
  234.             cin >> odp1;
  235.  
  236.             menueng::internet(odp, odp1);
  237.  
  238.  
  239.             break;
  240.         case 2:
  241.             cout << endl;
  242.             cout << " You have chosen option number[2] Your browser won't turn on, we'll be happy to help you" << endl << endl;
  243.             cout << "First, find out where the problem lies" << endl << endl;
  244.             cout << "Check if your browser has several browsers enabled!" << endl;
  245.             cout << "[1] Yes, several browsers are enabled " << endl;
  246.             cout << "[2] No, there are none included" << endl;
  247.             cout << "Tell me what the case looks like: ";
  248.             cin >> odp;
  249.  
  250.             cout << endl;
  251.             cout << "The issue still exists?: " << endl;
  252.             cout << "[1]Yes" << endl;
  253.             cout << "[2]No" << endl;
  254.             cout << "Select : ";
  255.             cin >> odp1;
  256.  
  257.             menueng::przegladarka(odp, odp1);
  258.  
  259.             break;
  260.         case 3:
  261.             cout << endl;
  262.             cout << "You have chosen option number [3] Artifacts appearing on the monitor" << endl << endl;
  263.             cout << "Check your graphics card to see if it's a problem" << endl;
  264.             cout << "[1] Yes" << endl;
  265.             cout << "[2] No" << endl;
  266.             cout << "Select again : ";
  267.             cin >> odp;
  268.  
  269.             menueng::screen(odp);
  270.  
  271.             break;
  272.         case 4:
  273.             cout << endl;
  274.             cout << "You have chosen option number [4] Inactive Pc off button" << endl;
  275.             cout << "Check if you have a damaged case from the PC" << endl;
  276.             cout << "[1]Yes it is broken" << endl;
  277.             cout << "[2]No, it's not broken" << endl;
  278.             cout << "Select :";
  279.             cin >> odp;
  280.  
  281.             cout << "You want to connect the POWER button controls yourself?" << endl;
  282.             cout << "[1] Yes" << endl;
  283.             cout << "[2] No" << endl;
  284.             cout << "Select: ";
  285.             cin >> odp1;
  286.  
  287.             menueng::PowerButton(odp, odp1);
  288.  
  289.             break;
  290.         case 5:
  291.             cout << "Thank you for using our program! I hope you were able to help :) " << endl;
  292.             exit(0);
  293.  
  294.             break;
  295.         case 6:
  296.             cout << "Chcesz wrocic do menu wyboru jezyka? /Do you want to return to the language selection menu?" << endl;
  297.             system("pause");
  298.             main();
  299.  
  300.             break;
  301.         default:
  302.             cout << "There is no such option in the menu!" << endl;
  303.             system("pause");
  304.             break;
  305.         }
  306.     }
  307.  
  308. }
  309. void menupl::internet(int a, int b)
  310. {
  311.     if (a == 1)
  312.     {
  313.         cout << endl;
  314.         cout << "Skontaktuj sie z dostawca internetu, badz sprawdz czy masz podlaczony kabel od internetu :) " << endl << endl;
  315.     }
  316.     else
  317.     {
  318.         cout << "Musisz wlaczyc router! " << endl << endl;
  319.  
  320.     }
  321.     if (b == 1)
  322.     {
  323.         cout << endl;
  324.         cout << "Cieszymy sie ze moglismy pomoc  :) !" << endl << endl;
  325.     }
  326.     else
  327.     {
  328.         cout << "Skontaktuj sie z dostawca swojego internetu, jest to wymgane!" << endl;
  329.  
  330.     }
  331.     system("pause");
  332.  
  333.  
  334. }
  335. void menupl::PowerButton(int a, int b)
  336. {
  337.     if (a == 1)
  338.     {
  339.         cout << endl;
  340.         cout << "Prosze o  sprawdzneie kontrolek na plycie glownej" << endl;
  341.     }
  342.     else
  343.     {
  344.         cout << "Jesli nie jest uszkodzona to sprawdz: \n -podlaczenie kontorlek w plycie glownej \n -sprawdz czy dobrze podlaczyles kontrolki \n " << endl;
  345.  
  346.     }
  347.     if (b == 1)
  348.     {
  349.         cout << "Przekieruje cie do storny ktora ci pomoze :)" << endl;
  350.         system("start chrome.exe https://www.pcformat.pl/Jak-podlaczyc--przedni-panel,a,2630");
  351.  
  352.     }
  353.     else
  354.     {
  355.         cout << "Udaj sie do informatyka niech on to zrobi za ciebie :)" << endl;
  356.         cout << "Ps. 50 zl w kieszeni lepiej miej :)" << endl;
  357.     }
  358.     system("pause");
  359.  
  360. }
  361. void menupl::przegladarka(int a, int b)
  362. {
  363.     if (a == 1)
  364.     {
  365.         cout << "Prosze o ich wylaczenie : -) i sprawdzeniu czy dziala" << endl;
  366.  
  367.     }
  368.     else
  369.     {
  370.         cout << "Uruchom ponownie komputer i sprawdz czy przegladarka dziala!" << endl;
  371.  
  372.     }
  373.     if (b == 1)
  374.     {
  375.         cout << "Zainstaluj ponownie przegladarke, badz zainstaluj inna :)" << endl;
  376.  
  377.     }
  378.     else
  379.     {
  380.         cout << "Cieszymy sie ze moglismy pomoc!" << endl;
  381.  
  382.     }
  383.     system("pause");
  384. }
  385. void menupl::screen(int a)
  386. {
  387.     if (a == 1)
  388.     {
  389.         cout << "Jesli problem lezy po stornie karty graficnzej. \n Prosze o jej jak najszybszy zakup i wymianie karty.graf " << endl;
  390.  
  391.     }
  392.     else
  393.     {
  394.         cout << "Jesli to nie wina karty graficznej, sprawdz monitor, badz skontaktuj sie z informatykiem w twoim miescie" << endl;
  395.     }
  396.     system("pause");
  397.  
  398. }
  399.  
  400. void menueng::internet(int a, int b)
  401. {
  402.     if (a == 1)
  403.     {
  404.         cout << endl;
  405.         cout << "Contact your internet provider, be sure you have an internet cable connected :) " << endl << endl;
  406.     }
  407.     else
  408.     {
  409.         cout << "You must turn on the router! " << endl << endl;
  410.  
  411.     }
  412.     if (b == 1)
  413.     {
  414.         cout << endl;
  415.         cout << "We are glad that we could help :) !" << endl << endl;
  416.     }
  417.     else
  418.     {
  419.         cout << "Contact your internet provider, this is required!" << endl;
  420.  
  421.     }
  422.     system("pause");
  423.  
  424.  
  425. }
  426. void menueng::PowerButton(int a, int b)
  427. {
  428.     if (a == 1)
  429.     {
  430.         cout << endl;
  431.         cout << "Please check the lights on the main board" << endl;
  432.     }
  433.     else
  434.     {
  435.         cout << "If it is not damaged, check: \ n - connecting the counter in the main board \ n - check if you have connected the controls correctly \ n " << endl;
  436.  
  437.     }
  438.     if (b == 1)
  439.     {
  440.         cout << "I will redirect you to a website that will help you :)" << endl;
  441.         system("start chrome.exe https://www.pcformat.pl/Jak-podlaczyc--przedni-panel,a,2630");
  442.  
  443.     }
  444.     else
  445.     {
  446.         cout << "Go to an IT specialist and let him do it for you :)" << endl;
  447.         cout << "Ps 50 zlotys in your pocket better have :)" << endl;
  448.     }
  449.     system("pause");
  450.  
  451. }
  452. void menueng::przegladarka(int a, int b)
  453. {
  454.     if (a == 1)
  455.     {
  456.         cout << "Please turn them off :-) and check if it works" << endl;
  457.  
  458.     }
  459.     else
  460.     {
  461.         cout << "Restart your computer and check if your browser works!" << endl;
  462.  
  463.     }
  464.     if (b == 1)
  465.     {
  466.         cout << "Reinstall browser, or install another :)" << endl;
  467.  
  468.     }
  469.     else
  470.     {
  471.         cout << "We are glad that we could help!" << endl;
  472.  
  473.     }
  474.     system("pause");
  475. }
  476. void menueng::screen(int a)
  477. {
  478.     if (a == 1)
  479.     {
  480.         cout << "If the problem is with the graphics card. \ n Please purchase and replace the graphics card as soon as possible" << endl;
  481.  
  482.     }
  483.     else
  484.     {
  485.         cout << "If this is not the fault of the graphics card, check the monitor, or contact an IT specialist in your city" << endl;
  486.     }
  487.     system("pause");
  488.  
  489. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement