Facebook
From Mammoth Tortoise, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 197
  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 Komputer
  10.     {
  11.        
  12.         bool stan;
  13.         string colour;
  14.         double processor;
  15.         int graphic;
  16.        
  17.         public  Komputer()
  18.         {
  19.             stan = false;
  20.             processor = 3.16;
  21.             graphic = 2048;
  22.         }
  23.         public void check()
  24.         {
  25.             if(stan)
  26.             {
  27.                 Console.WriteLine("Komputer jest wlaczony!");
  28.             }
  29.             else
  30.             {
  31.                 Console.WriteLine("Komputer jest wylaczony!");
  32.             }
  33.             if(processor==3.16 && graphic==2048)
  34.             {
  35.                 Console.WriteLine("Procesor i grafika w trybie oszczędności energii ");
  36.             }
  37.             else
  38.             {
  39.                 Console.WriteLine("Procesor i grafika w trybie wyższej wydajności");
  40.             }
  41.         }
  42.         public void start()
  43.         {
  44.             if(stan)
  45.             {
  46.                 stan = false;
  47.             }
  48.             else
  49.             {
  50.                 stan = true;
  51.             }
  52.         }
  53.        public void tryb(ref Komputer x)
  54.         {
  55.             if (stan)
  56.             {
  57.  
  58.  
  59.                 if (x.processor == 3.16 && x.graphic == 2048)
  60.                 {
  61.                     x.processor = 3.26;
  62.                     x.graphic = 4096;
  63.                 }
  64.                 else
  65.                 {
  66.                     x.processor = 3.16;
  67.                     graphic = 2048;
  68.                 }
  69.             }
  70.             else
  71.             {
  72.                 Console.WriteLine("Komputer jest wylaczony!");
  73.             }
  74.         }
  75.         private void boost(Komputer x)
  76.         {
  77.             x.processor += 3.55;
  78.             x.graphic += 6144;
  79.         }
  80.  
  81.         public Komputer(Komputer x)
  82.         {
  83.             this.stan = x.stan;
  84.             this.processor = x.processor;
  85.             this.graphic = x.graphic;
  86.  
  87.         }
  88.  
  89.         ~Komputer() { Console.WriteLine("Konstruktor Komputer"); }
  90.     }
  91.  
  92.     class Mp3
  93.     {
  94.         bool stan;
  95.         bool battery;
  96.         int songs;
  97.         int memory;
  98.  
  99.         public Mp3()
  100.         {
  101.             stan = false;
  102.             battery = true;
  103.             songs = 666;
  104.             memory = 1024;
  105.         }
  106.  
  107.  
  108.         public void start(ref Mp3 x)
  109.         {
  110.             if (x.stan)
  111.             {
  112.                 x.stan = false;
  113.             }
  114.             else
  115.             {
  116.                 x.stan = true;
  117.             }
  118.         }
  119.  
  120.         public void check(Mp3 x)
  121.         {
  122.             if(stan&&battery)
  123.             {
  124.                 Console.WriteLine("Urzadzenie jest wlaczone!");
  125.             }
  126.             else
  127.             {
  128.                 Console.WriteLine("Urzadzenie jest wylaczone!");
  129.             }
  130.             if (battery)
  131.             {
  132.                 Console.WriteLine("Baterie sa wlozone!");
  133.             }
  134.             else
  135.             {
  136.                 Console.WriteLine("Brak bateri!");
  137.             }
  138.             Console.WriteLine("W pamieci jest: " + songs);
  139.             Console.WriteLine("Pamiec wynosi: " + memory);
  140.         }
  141.        public  Mp3 (Mp3 x)
  142.         {
  143.             this.stan = x.stan;
  144.             this.battery = x.battery;
  145.             this.songs = x.songs;
  146.             this.memory = x.memory;
  147.         }
  148.  
  149.         private void boost (Mp3 x)
  150.         {
  151.             x.memory += 2048;
  152.         }
  153.  
  154.         ~Mp3() { Console.WriteLine("Konstruktor MP3"); }
  155.     }
  156.     class Program
  157.     {
  158.         static void Main(string[] args)
  159.         {
  160.             Komputer laptop = new Komputer();
  161.             Mp3 samsung = new Mp3();
  162.             int wybor;
  163.             Console.WriteLine("Witaj w menu! Wybierz urzadzennie: 1. Komputer 2.Mp3");
  164.             wybor = int.Parse(Console.ReadLine());
  165.             switch (wybor)
  166.             {
  167.                 case 1:
  168.                     laptop.check();
  169.                     Console.WriteLine("Wybierz, co chcesz zrobic: 1.Wlacz komputer 2.Zmien 3.Wyjdz ");
  170.                     wybor=int.Parse(Console.ReadLine());
  171.                     if (wybor != 3)
  172.                     {
  173.                         switch (wybor)
  174.                         {
  175.                             case 1:
  176.                                 laptop.start();
  177.                                 break;
  178.                             case 2:
  179.                                 laptop.
  180.                         }
  181.                     }
  182.  
  183.             }
  184.         }
  185.     }
  186. }
  187.