Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Zadanie5
  8. {
  9.     class Laptop
  10.     {
  11.        
  12.         private static string _sterownik  = "NVIDIA67658";
  13.         public int ram { get; set; }
  14.         public int numerAplikacji { get; set; }
  15.         public int glosnosc { get; set; }
  16.        
  17.  
  18.  
  19.         public static string sterownik
  20.         {
  21.             get
  22.             {
  23.                 return _sterownik;
  24.             }
  25.             set
  26.             {
  27.                 _sterownik = value;
  28.             }
  29.         }
  30.        
  31.         public Laptop(int ram)
  32.         {
  33.             this.ram = ram;
  34.         }
  35.         public Laptop(Laptop laptop)
  36.         {
  37.             ram = laptop.ram;
  38.             numerAplikacji = laptop.numerAplikacji;
  39.             glosnosc = laptop.glosnosc;
  40.            
  41.         }
  42.         public static void WypiszSterownikKartyGraficznej()
  43.         {
  44.             Console.WriteLine("Najnowszy sterownik karty graficznej to: " + _sterownik);
  45.         }
  46.         public static Laptop operator +(Laptop lap1, Laptop lap2)
  47.         {
  48.             Laptop lap3 = new Laptop(1);
  49.             lap3 = lap1 + lap2;
  50.             return lap3;
  51.         }
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. // od tad w dó lnie musisz patrzec
  59.  
  60.  
  61.        
  62.         public void RysujLaptop()
  63.         {
  64.  
  65.             Console.WriteLine();
  66.             Console.WriteLine("Laptop");
  67.             Console.WriteLine();
  68.             Console.WriteLine("****************");
  69.             for (int i = 0; i < 4; i++)
  70.             {
  71.                 Console.WriteLine("**------------**");
  72.             }
  73.             Console.WriteLine("****************");
  74.             Console.WriteLine(" **++++++++++++**");
  75.             Console.WriteLine("  **++++++++++++**");
  76.             Console.WriteLine("   **++++++++++++**");
  77.             Console.WriteLine("    ****************");
  78.  
  79.  
  80.         }
  81.         public void ZmiejszGlosnosc(ref int guzik, int ile)
  82.         {
  83.             guzik = guzik - ile;
  84.             Console.WriteLine("Zmniejszyłeś głośność o " + ile + ", teraz głośność wynosi " + guzik);
  85.  
  86.         }
  87.         public void ZwiekszGlosnosc(ref int guzik, int ile)
  88.         {
  89.             guzik = guzik + ile;
  90.             Console.WriteLine("Zwiększyłeś głośność o " + ile + ", teraz głośność wynosi " + guzik);
  91.         }
  92.         public void WlaczAplikacje(int aplikacja)
  93.         {
  94.             numerAplikacji = aplikacja;
  95.             switch (numerAplikacji)
  96.             {
  97.  
  98.                 case 1:
  99.                     Console.WriteLine("Włączyłeś Visual Studio 2017.");
  100.                     break;
  101.                 case 2:
  102.                     Console.WriteLine("Włączyłeś PowerPoint.");
  103.                     break;
  104.                 case 3:
  105.                     Console.WriteLine("Włączyłeś Opere.");
  106.                     break;
  107.                 default:
  108.                    
  109.                     break;
  110.             }
  111.         }
  112.         public void Blad(out bool warunek)
  113.         {
  114.             warunek = true;
  115.             Console.WriteLine();
  116.             Console.WriteLine("Wybrałeś niepoprawną aplikacje!!!!!!-_-!!!!!!");
  117.             Console.WriteLine("ERROR 404 - Nie znaleziono pliku");
  118.             Console.WriteLine();
  119.             Console.WriteLine("****************");
  120.             for (int i = 0; i < 4; i++)
  121.             {
  122.                 Console.ForegroundColor = ConsoleColor.Blue;
  123.                 Console.WriteLine("**------------**");
  124.             }
  125.             Console.ResetColor();
  126.             Console.WriteLine("****************");
  127.             Console.WriteLine(" **++++++++++++**");
  128.             Console.WriteLine("  **++++++++++++**");
  129.             Console.WriteLine("   **++++++++++++**");
  130.             Console.WriteLine("    ****************");
  131.  
  132.         }
  133.        
  134.     }
  135. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement