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;
- class Osoba
- {
- protected string imie = null;
- protected string data = null;
- protected string nazwisko = null;
- public Osoba(string imie_, string data_, string nazwisko_)
- {
- imie = imie_;
- data = data_;
- nazwisko = nazwisko_;
- }
- internal void WypiszInfo()
- {
- throw new NotImplementedException();
- }
- internal void StrzelGola()
- {
- throw new NotImplementedException();
- }
- }
- class Student: Osoba
- {
- private int rok;
- private int grupa;
- private int nrIndeksu;
- public Student (string imie_, string data_, string nazwisko_, int rok_, int grupa_, int nrIndeksu_) : base(imie_, data_, nazwisko_)
- {
- rok_ = rok;
- grupa_ = grupa;
- nrIndeksu_ = nrIndeksu;
- }
- }
- class Pilkarz : Osoba
- {
- private string pozycja;
- private string klub;
- public Pilkarz(string imie_, string data_, string nazwisko_, string pozycja_, string klub_) : base(imie_, data_, nazwisko_)
- {
- pozycja_ = pozycja;
- klub_ = klub;
- }
- }
- static void Main(string[] ards)
- {
- Osoba o = new Osoba("Adam", "Mis", "20,03,1980");
- Osoba o2 = new Student("Michal", "Kot", "13.04.1990", 2, 1, 12345);
- Osoba o3 = new Pilkarz("Mateusz", "Zbik", "10.08.1984", "obronca", "FC Czestochowa");
- o.WypiszInfo();
- o2.WypiszInfo();
- o3.WypiszInfo();
- Student s = new Student("Krzysztof", "Jez", "22.12.1990", 2, 5, 54321);
- Pilkarz p = new Pilkarz("Piotr", "Kos", "14.09.1984", "napastnik", "FC Politechnika");
- s.WypiszInfo();
- p.WypiszInfo();
- o3.StrzelGola();
- p.StrzelGola();
- p.StrzelGola();
- o3.WypiszInfo();
- p.WypiszInfo();
- Console.ReadKey();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement