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 RezerwacjaBiletow
- {
- class Program
- {
- class SystemLotnisk
- {
- private IList<Lotnisko> lotniska;
- public SystemLotnisk()
- {
- lotniska = new List<Lotnisko>();
- }
- public void dodajLotnisko(Lotnisko lt)
- {
- lotniska.Add(lt);
- }
- public List<Lotnisko> getLotniska()
- {
- return (List<Lotnisko>)lotniska;
- }
- }
- class Lotnisko
- {
- private IList<Klient> klienci;
- private IList<Samolot> samoloty;
- public Lotnisko()
- {
- klienci = new List<Klient>();
- samoloty = new List<Samolot>();
- }
- public void dodajKlienta(Klient kl)
- {
- klienci.Add(kl);
- }
- public void dodajSamolot(Samolot s)
- {
- samoloty.Add(s);
- }
- public List<Klient> getKlienci()
- {
- return (List<Klient>)klienci;
- }
- public List<Samolot> getSamoloty()
- {
- return (List<Samolot>)samoloty;
- }
- }
- class Klient
- {
- private IList<Rezerwacja> rezerwacje;
- public Klient()
- {
- rezerwacje = new List<Rezerwacja>();
- }
- public void dodajRezerwacje(Rezerwacja r)
- {
- rezerwacje.Add(r);
- }
- public List<Rezerwacja> getRezerwacje()
- {
- return (List<Rezerwacja>)rezerwacje;
- }
- }
- class KlientIndywidualny : Klient
- {
- protected string imie;
- protected string nazwisko;
- protected string PESEL;
- public KlientIndywidualny(string imie, string nazwisko, string PESEL) : base()
- {
- this.imie = imie;
- this.nazwisko = nazwisko;
- this.PESEL = PESEL;
- }
- }
- class PosrednikFirmy : KlientIndywidualny
- {
- private string nazwa_firmy;
- private string KRS;
- public PosrednikFirmy(string imie, string nazwisko, string PESEL, string nazwa_firmy, string KRS) : base(imie, nazwisko, PESEL)
- {
- this.nazwa_firmy = nazwa_firmy;
- this.KRS = KRS;
- }
- }
- class Samolot
- {
- protected int liczba_miejsc;
- protected double zasieg;
- public Samolot(int liczba_miejsc,double zasieg)
- {
- this.liczba_miejsc = liczba_miejsc;
- this.zasieg = zasieg;
- }
- }
- class MalySamolot : Samolot
- {
- public MalySamolot(int liczba_miejsc, double zasieg) : base(liczba_miejsc, zasieg)
- {
- this.liczba_miejsc = 100;
- this.zasieg = 1000;
- }
- }
- class SredniSamolot : Samolot
- {
- public SredniSamolot(int liczba_miejsc, double zasieg) : base(liczba_miejsc, zasieg)
- {
- this.liczba_miejsc = 200;
- this.zasieg = 2000;
- }
- }
- class DuzySamolot : Samolot
- {
- public DuzySamolot(int liczba_miejsc, double zasieg) : base(liczba_miejsc, zasieg)
- {
- this.liczba_miejsc = 500;
- this.zasieg = 5000;
- }
- }
- class Rezerwacja
- {
- protected string data_wylotu;
- protected string data_powrotu;
- protected string miejsce_wylotu;
- protected string miejsce_przylotu;
- private IList<Lot> loty;
- public Rezerwacja()
- {
- loty = new List<Lot>();
- }
- public void dodajLot(Lot l)
- {
- loty.Add(l);
- }
- public List<Lot> getLoty()
- {
- return (List<Lot>)loty;
- }
- }
- class Lot : Rezerwacja
- {
- protected double odleglosc;
- string typ_samolotu;
- public Lot(string data_wylotu, string data_powrotu, string miejsce_wylotu, string miejsce_przylotu, double odleglosc, string typ_samolotu) : base(data_wylotu, data_powrotu, miejsce_wylotu, miejsce_przylotu)
- {
- this.odleglosc = odleglosc;
- this.typ_samolotu = typ_samolotu;
- }
- }
- class GeneratorLotow : Lot
- {
- public GeneratorLotow(string data_wylotu, string data_powrotu, string miejsce_wylotu, string miejsce_przylotu, double odleglosc, string typ_samolotu) : base(data_wylotu, data_powrotu, miejsce_wylotu, miejsce_przylotu, odleglosc, typ_samolotu)
- {
- }
- public void dobierzSamolot()
- {
- }
- public void powielLot()
- {
- }
- }
- static void Main(string[] args)
- {
- int wybor = 0;
- do
- {
- Console.WriteLine("Witamy w systemie rezerwacji biletow:");
- Console.WriteLine();
- Console.WriteLine("1 - Dodaj Lotnisko");
- Console.WriteLine("2 - Usun Lotnisko");
- Console.WriteLine("3 - Przeglad Lotnisk");
- Console.WriteLine("0 - Wyjdz z systemu");
- wybor = Int32.Parse(Console.ReadLine());
- SystemLotnisk slt = new SystemLotnisk();
- switch (wybor)
- {
- case 1:
- break;
- case 2:
- break;
- case 3:
- break;
- }
- } while (wybor != 0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement