Facebook
From Bitty Tern, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 211
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace KonKopiujący
  8. {
  9.     class Program
  10.     {
  11.  
  12.         static void Testuj(Komputer x, Mp3 y,out int wyb, out string zmien)
  13.         {
  14.             x = new Komputer();
  15.             y = new Mp3();
  16.  
  17.             wyb = 0;
  18.             zmien = "TEST";
  19.             do
  20.             {
  21.                 Console.WriteLine("Wpisz 1, aby zmieniac wartosci komputera. Wpisz 2, aby zmieniac wartosci Mp3. Wpisz 5, aby wyjsc");
  22.                 wyb = int.Parse(Console.ReadLine());
  23.                 switch (wyb)
  24.                 {
  25.                     case 1:
  26.                         do
  27.                         {
  28.  
  29.  
  30.                             Console.WriteLine("1. Zmiana koloru obudowy 2. Zmiana wartosci procesora 3. Zmiana wartosci pamieci karty graficznej 6. Wyjdz ");
  31.                             wyb = int.Parse(Console.ReadLine());
  32.                             switch (wyb)
  33.                             {
  34.                                 case 1:
  35.                                     Console.WriteLine("Prosze podac nowy kolor: ");
  36.                                     x.WColour = Console.ReadLine();
  37.                                     break;
  38.                                 case 2:
  39.                                     Console.WriteLine("Prosze podac nowa wartosc double procesora");
  40.                                     x.WProcessor = double.Parse(Console.ReadLine());
  41.                                     break;
  42.                                 case 3:
  43.                                     Console.WriteLine("Proszę podać nową wartość int dla pamięci karty graficznej ");
  44.                                     x.WGraphic = int.Parse(Console.ReadLine());
  45.                                     break;
  46.                             }
  47.                         } while (wyb != 6);
  48.                         break;
  49.                     case 2:
  50.                         do
  51.                         {
  52.  
  53.  
  54.                             Console.WriteLine("1. Zmień ilość piosenek 2. Zmień ilość pamięci 7.Wyjdz ");
  55.                             wyb = int.Parse(Console.ReadLine());
  56.                             switch (wyb)
  57.                             {
  58.                                 case 1:
  59.                                     Console.WriteLine("Prosze podać ilość nowych piosenek: ");
  60.                                     y.WSongs = int.Parse(Console.ReadLine());
  61.                                     break;
  62.                                 case 2:
  63.                                     Console.WriteLine("Prosze podac nowa wartosc pamięci");
  64.                                     y.WMemory = int.Parse(Console.ReadLine());
  65.                                     break;
  66.                             }
  67.                         } while (wyb != 7);
  68.                         break;
  69.                 }
  70.             } while (wyb != 5);
  71.  
  72.         }
  73.         static void DokonajWyboru(ref int x)
  74.         {
  75.             x = int.Parse(Console.ReadLine());
  76.         }
  77.  
  78.         static void Main(string[] args)
  79.         {
  80.             Komputer laptop = new Komputer();
  81.             Mp3 samsung = new Mp3();
  82.             Komputer TestLaptop = new Komputer(laptop);
  83.             Mp3 TestMP3 = new Mp3(samsung);
  84.  
  85.             int TestWybor;
  86.             string TestZmien;
  87.             int wybor=0;
  88.             double przelicznik;
  89.             do
  90.             {
  91.                 Console.WriteLine("Witaj w menu! Wybierz urzadzennie: 1. Komputer 2.Mp3 3. Testuj 4. przelicz RAM 5. Porownaj prad 9.Zakończ");
  92.                 DokonajWyboru(ref wybor);
  93.                 switch (wybor)
  94.                 {
  95.  
  96.                     case 1:
  97.                         do
  98.                         {
  99.                             laptop.Check();
  100.                             Console.WriteLine("Wybierz, co chcesz zrobic: 1.Wlacz komputer 2.Zmien 8.Wyjdz ");
  101.                             wybor = int.Parse(Console.ReadLine());
  102.                             switch (wybor)
  103.                             {
  104.                                 case 1:
  105.                                     laptop.Start();
  106.                                     break;
  107.                                 case 2:
  108.                                     laptop.Tryb();
  109.                                     break;
  110.                                 case 3:
  111.                                     break;
  112.                             }
  113.                         } while (wybor != 8);
  114.                 break;
  115.        
  116.                     case 2:
  117.                         do
  118.                         {
  119.                             samsung.Check();
  120.                             Console.WriteLine("Wybierz, co chcesz zrobić: 1. Włącz 2. Dokup losowe piosenki 7. Wyjdz");
  121.                             wybor = int.Parse(Console.ReadLine());
  122.                             switch (wybor)
  123.                             {
  124.                                 case 1:
  125.                                     samsung.Start();
  126.                                     break;
  127.                                 case 2:
  128.                                     samsung.Dokup();
  129.                                     break;
  130.                                 case 3:
  131.                                     break;
  132.                             }
  133.                         } while (wybor != 7);
  134.                         break;
  135.  
  136.                     case 3:
  137.                         Testuj(TestLaptop, TestMP3, out TestWybor, out TestZmien);
  138.                         Console.WriteLine("Nowe wartości komponentów testowych komputera: ");
  139.                         Console.WriteLine("Kolor: " + TestLaptop.WColour);
  140.                         Console.WriteLine("Procesor: " + TestLaptop.WProcessor);
  141.                         Console.WriteLine("Karta graficzna: " + TestLaptop.WGraphic);
  142.                         Console.WriteLine("Nowe wartości komponentów testowych Mp3: ");
  143.                         Console.WriteLine("Ilość piosenek: " + TestMP3.WSongs);
  144.                         Console.WriteLine("Ilość pamięci: " + TestMP3.WMemory);
  145.                         Console.WriteLine("Nowa wartosc zmiennej wyboru: " + TestWybor);
  146.  
  147.  
  148.                         break;
  149.  
  150.                     case 4:
  151.                         Console.WriteLine("Podaj ile mb RAM chciałbyś przeliczyć: ");
  152.                         przelicznik= double.Parse(Console.ReadLine());
  153.                         Console.WriteLine(" " + przelicznik + " to " + Komputer.RAM(przelicznik) + "gb ram! ");
  154.                         break;
  155.                     case 5:
  156.                         Console.WriteLine("Przeciązanie operatorów.");
  157.                         Komputer Test1 = new Komputer();
  158.                         Test1.WElektrycity = 10000;
  159.                         if (Test1 > laptop)
  160.                         {
  161.                             Console.WriteLine("Test1 pobiera więcej prądu niż laptop!");
  162.                         }
  163.                         else
  164.                         {
  165.                             Console.WriteLine("Tlaptop zjada więcej prądu niż Test1!");
  166.                         }
  167.                         Mp3 TestMp1 = new Mp3();
  168.                         TestMp1.WElektrycity = 10000;
  169.                         if (TestMp1 > samsung)
  170.                         {
  171.                             Console.WriteLine("TestMp1 pobiera więcej prądu niż samsung!");
  172.                         }
  173.                         else
  174.                         {
  175.                             Console.WriteLine("samsung zjada więcej prądu niż TestMp1!");
  176.                         }
  177.                         break;
  178.                 }
  179.             } while (wybor != 9);
  180.         }
  181.     }
  182. }
  183.