Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Zadanie5
- {
- class Laptop
- {
- private static string _sterownik = "NVIDIA67658";
- public int ram { get; set; }
- public int numerAplikacji { get; set; }
- public int glosnosc { get; set; }
- public static string sterownik
- {
- get
- {
- return _sterownik;
- }
- set
- {
- _sterownik = value;
- }
- }
- public Laptop(int ram)
- {
- this.ram = ram;
- }
- public Laptop(Laptop laptop)
- {
- ram = laptop.ram;
- numerAplikacji = laptop.numerAplikacji;
- glosnosc = laptop.glosnosc;
- }
- public static void WypiszSterownikKartyGraficznej()
- {
- Console.WriteLine("Najnowszy sterownik karty graficznej to: " + _sterownik);
- }
- public static Laptop operator +(Laptop lap1, Laptop lap2)
- {
- Laptop lap3 = new Laptop(1);
- lap3 = lap1 + lap2;
- return lap3;
- }
- // od tad w dó lnie musisz patrzec
- public void RysujLaptop()
- {
- Console.WriteLine();
- Console.WriteLine("Laptop");
- Console.WriteLine();
- Console.WriteLine("****************");
- for (int i = 0; i < 4; i++)
- {
- Console.WriteLine("**------------**");
- }
- Console.WriteLine("****************");
- Console.WriteLine(" **++++++++++++**");
- Console.WriteLine(" **++++++++++++**");
- Console.WriteLine(" **++++++++++++**");
- Console.WriteLine(" ****************");
- }
- public void ZmiejszGlosnosc(ref int guzik, int ile)
- {
- guzik = guzik - ile;
- Console.WriteLine("Zmniejszyłeś głośność o " + ile + ", teraz głośność wynosi " + guzik);
- }
- public void ZwiekszGlosnosc(ref int guzik, int ile)
- {
- guzik = guzik + ile;
- Console.WriteLine("Zwiększyłeś głośność o " + ile + ", teraz głośność wynosi " + guzik);
- }
- public void WlaczAplikacje(int aplikacja)
- {
- numerAplikacji = aplikacja;
- switch (numerAplikacji)
- {
- case 1:
- Console.WriteLine("Włączyłeś Visual Studio 2017.");
- break;
- case 2:
- Console.WriteLine("Włączyłeś PowerPoint.");
- break;
- case 3:
- Console.WriteLine("Włączyłeś Opere.");
- break;
- default:
- break;
- }
- }
- public void Blad(out bool warunek)
- {
- warunek = true;
- Console.WriteLine();
- Console.WriteLine("Wybrałeś niepoprawną aplikacje!!!!!!-_-!!!!!!");
- Console.WriteLine("ERROR 404 - Nie znaleziono pliku");
- Console.WriteLine();
- Console.WriteLine("****************");
- for (int i = 0; i < 4; i++)
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- Console.WriteLine("**------------**");
- }
- Console.ResetColor();
- Console.WriteLine("****************");
- Console.WriteLine(" **++++++++++++**");
- Console.WriteLine(" **++++++++++++**");
- Console.WriteLine(" **++++++++++++**");
- Console.WriteLine(" ****************");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement