- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace KonKopiujący
- {
- class Program
- {
- static void Testuj(Komputer x, Mp3 y,out int wyb, out string zmien)
- {
- x = new Komputer();
- y = new Mp3();
- wyb = 0;
- zmien = "TEST";
- do
- {
- Console.WriteLine("Wpisz 1, aby zmieniac wartosci komputera. Wpisz 2, aby zmieniac wartosci Mp3. Wpisz 5, aby wyjsc");
- wyb = int.Parse(Console.ReadLine());
- switch (wyb)
- {
- case 1:
- do
- {
- Console.WriteLine("1. Zmiana koloru obudowy 2. Zmiana wartosci procesora 3. Zmiana wartosci pamieci karty graficznej 6. Wyjdz ");
- wyb = int.Parse(Console.ReadLine());
- switch (wyb)
- {
- case 1:
- Console.WriteLine("Prosze podac nowy kolor: ");
- x.WColour = Console.ReadLine();
- break;
- case 2:
- Console.WriteLine("Prosze podac nowa wartosc double procesora");
- x.WProcessor = double.Parse(Console.ReadLine());
- break;
- case 3:
- Console.WriteLine("Proszę podać nową wartość int dla pamięci karty graficznej ");
- x.WGraphic = int.Parse(Console.ReadLine());
- break;
- }
- } while (wyb != 6);
- break;
- case 2:
- do
- {
- Console.WriteLine("1. Zmień ilość piosenek 2. Zmień ilość pamięci 7.Wyjdz ");
- wyb = int.Parse(Console.ReadLine());
- switch (wyb)
- {
- case 1:
- Console.WriteLine("Prosze podać ilość nowych piosenek: ");
- y.WSongs = int.Parse(Console.ReadLine());
- break;
- case 2:
- Console.WriteLine("Prosze podac nowa wartosc pamięci");
- y.WMemory = int.Parse(Console.ReadLine());
- break;
- }
- } while (wyb != 7);
- break;
- }
- } while (wyb != 5);
- }
- static void DokonajWyboru(ref int x)
- {
- x = int.Parse(Console.ReadLine());
- }
- static void Main(string[] args)
- {
- Komputer laptop = new Komputer();
- Mp3 samsung = new Mp3();
- Komputer TestLaptop = new Komputer(laptop);
- Mp3 TestMP3 = new Mp3(samsung);
- int TestWybor;
- string TestZmien;
- int wybor=0;
- double przelicznik;
- do
- {
- Console.WriteLine("Witaj w menu! Wybierz urzadzennie: 1. Komputer 2.Mp3 3. Testuj 4. przelicz RAM 5. Porownaj prad 9.Zakończ");
- DokonajWyboru(ref wybor);
- switch (wybor)
- {
- case 1:
- do
- {
- laptop.Check();
- Console.WriteLine("Wybierz, co chcesz zrobic: 1.Wlacz komputer 2.Zmien 8.Wyjdz ");
- wybor = int.Parse(Console.ReadLine());
- switch (wybor)
- {
- case 1:
- laptop.Start();
- break;
- case 2:
- laptop.Tryb();
- break;
- case 3:
- break;
- }
- } while (wybor != 8);
- break;
- case 2:
- do
- {
- samsung.Check();
- Console.WriteLine("Wybierz, co chcesz zrobić: 1. Włącz 2. Dokup losowe piosenki 7. Wyjdz");
- wybor = int.Parse(Console.ReadLine());
- switch (wybor)
- {
- case 1:
- samsung.Start();
- break;
- case 2:
- samsung.Dokup();
- break;
- case 3:
- break;
- }
- } while (wybor != 7);
- break;
- case 3:
- Testuj(TestLaptop, TestMP3, out TestWybor, out TestZmien);
- Console.WriteLine("Nowe wartości komponentów testowych komputera: ");
- Console.WriteLine("Kolor: " + TestLaptop.WColour);
- Console.WriteLine("Procesor: " + TestLaptop.WProcessor);
- Console.WriteLine("Karta graficzna: " + TestLaptop.WGraphic);
- Console.WriteLine("Nowe wartości komponentów testowych Mp3: ");
- Console.WriteLine("Ilość piosenek: " + TestMP3.WSongs);
- Console.WriteLine("Ilość pamięci: " + TestMP3.WMemory);
- Console.WriteLine("Nowa wartosc zmiennej wyboru: " + TestWybor);
- break;
- case 4:
- Console.WriteLine("Podaj ile mb RAM chciałbyś przeliczyć: ");
- przelicznik= double.Parse(Console.ReadLine());
- Console.WriteLine(" " + przelicznik + " to " + Komputer.RAM(przelicznik) + "gb ram! ");
- break;
- case 5:
- Console.WriteLine("Przeciązanie operatorów.");
- Komputer Test1 = new Komputer();
- Test1.WElektrycity = 10000;
- if (Test1 > laptop)
- {
- Console.WriteLine("Test1 pobiera więcej prądu niż laptop!");
- }
- else
- {
- Console.WriteLine("Tlaptop zjada więcej prądu niż Test1!");
- }
- Mp3 TestMp1 = new Mp3();
- TestMp1.WElektrycity = 10000;
- if (TestMp1 > samsung)
- {
- Console.WriteLine("TestMp1 pobiera więcej prądu niż samsung!");
- }
- else
- {
- Console.WriteLine("samsung zjada więcej prądu niż TestMp1!");
- }
- break;
- }
- } while (wybor != 9);
- }
- }
- }