Facebook
From Unique Monkey, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 244
  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.         public bool stan;
  13.         public string colour;
  14.         public double processor;
  15.         public int graphic;
  16.         public static double wynik;
  17.         public int elektrycity;
  18.  
  19.         public Komputer()
  20.         {
  21.             stan = false;
  22.             processor = 3.16;
  23.             graphic = 2048;
  24.             colour = "red";
  25.             wynik = 0;
  26.             elektrycity = 0;
  27.         }
  28.         public string WColour
  29.         {
  30.             get
  31.             {
  32.                 return colour;
  33.             }
  34.             set
  35.             {
  36.                 colour = value;
  37.             }
  38.         }
  39.          public double WProcessor { get; set; }
  40.      
  41.         public int WGraphic
  42.         {
  43.             get
  44.             {
  45.                 return graphic;
  46.             }
  47.             set
  48.             {
  49.                 graphic = value;
  50.             }
  51.         }
  52.  
  53.         public int WElektrycity
  54.         {
  55.             set
  56.             {
  57.                 elektrycity = value;
  58.             }
  59.         }
  60.  
  61.         public void Check()
  62.         {
  63.             if (stan)
  64.             {
  65.                 Console.WriteLine("Komputer jest wlaczony!");
  66.             }
  67.             else
  68.             {
  69.                 Console.WriteLine("Komputer jest wylaczony!");
  70.             }
  71.             if (processor == 3.16 && graphic == 2048)
  72.             {
  73.                 Console.WriteLine("Procesor i grafika w trybie oszczędności energii ");
  74.             }
  75.             else
  76.             {
  77.                 Console.WriteLine("Procesor i grafika w trybie wyższej wydajności");
  78.             }
  79.         }
  80.         public void Start()
  81.         {
  82.             if (stan)
  83.             {
  84.                 stan = false;
  85.                 elektrycity = 0;
  86.             }
  87.             else
  88.             {
  89.                 stan = true;
  90.                 elektrycity = 100;
  91.             }
  92.         }
  93.         public void Tryb()
  94.         {
  95.             if (stan)
  96.             {
  97.                 if (processor == 3.16 && graphic == 2048)
  98.                 {
  99.                     processor = 3.16;
  100.                     graphic = 4096;
  101.                 }
  102.                 else
  103.                 {
  104.                     processor = 3.16;
  105.                     graphic = 2048;
  106.                 }
  107.             }
  108.             else
  109.             {
  110.                 Console.WriteLine("Komputer jest wylaczony!");
  111.             }
  112.         }
  113.         private void Boost(Komputer x)
  114.         {
  115.             x.processor += 3.55;
  116.             x.graphic += 6144;
  117.         }
  118.  
  119.         public static double RAM(double x)
  120.         {
  121.             double wynik = x / 1024;
  122.             return wynik;
  123.         }
  124.  
  125.         public Komputer(Komputer x)
  126.         {
  127.             this.stan = x.stan;
  128.             this.processor = x.processor;
  129.             this.graphic = x.graphic;
  130.             this.colour = x.colour;
  131.  
  132.         }
  133.  
  134.         public static Komputer operator +(Komputer lx, Komputer rx)
  135.         {
  136.             Komputer C = new Komputer();
  137.             C.processor = lx.processor + rx.processor;
  138.             C.graphic = lx.graphic + rx.graphic;
  139.             return C;
  140.         }
  141.  
  142.         public static bool operator <(Komputer lx, Komputer rx)
  143.         {
  144.             return (lx.elektrycity < rx.elektrycity);
  145.         }
  146.         public static bool operator >(Komputer lx, Komputer rx)
  147.         {
  148.             return (lx.elektrycity > rx.elektrycity);
  149.         }
  150.     }
  151. }
  152.