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 ConsoleApp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- Komputer Msi = new Komputer("intel","MSI", "NVIDIA", 17.3);
- Komputer Lenovo = new Komputer("amd", "LENOVO", "NVIDIA", 15.6);
- Msi.WypiszModel();
- Lenovo.WypiszModel();
- Console.ReadLine();}}
- class Komputer
- { // inicjalizacja zmiennych
- public string modelProcesora;
- public string producent;
- public double ekran;
- public string karta;
- //konstruktor
- public Komputer(string mProc, string prod, string kartaa, double ekrann)
- { modelProcesora = mProc;
- karta = kartaa;
- ekran = ekrann;
- producent = prod;}
- //metody
- public void WypiszModel()
- {
- Console.WriteLine("Nazwa producento to:" + modelProcesora);
- Console.WriteLine("Karta graficzna:" + karta);
- Console.WriteLine("przekatna ekranu to:" + ekran);
- Console.WriteLine("Model procesora to:" + modelProcesora);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement