Advertisement
Guest User

Untitled

a guest
May 31st, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.22 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 RezerwacjaBiletow
  8. {
  9.     class Program
  10.     {
  11.         class SystemLotnisk
  12.         {
  13.  
  14.             private IList<Lotnisko> lotniska;
  15.             public SystemLotnisk()
  16.             {
  17.                 lotniska = new List<Lotnisko>();
  18.             }
  19.             public void dodajLotnisko(Lotnisko lt)
  20.             {
  21.                 lotniska.Add(lt);
  22.             }
  23.             public List<Lotnisko> getLotniska()
  24.             {
  25.                 return (List<Lotnisko>)lotniska;
  26.             }
  27.         }
  28.         class Lotnisko
  29.         {
  30.             private IList<Klient> klienci;
  31.             private IList<Samolot> samoloty;
  32.             public Lotnisko()
  33.             {
  34.                 klienci = new List<Klient>();
  35.                 samoloty = new List<Samolot>();
  36.             }
  37.             public void dodajKlienta(Klient kl)
  38.             {
  39.                 klienci.Add(kl);
  40.             }
  41.             public void dodajSamolot(Samolot s)
  42.             {
  43.                 samoloty.Add(s);
  44.             }
  45.             public List<Klient> getKlienci()
  46.             {
  47.                 return (List<Klient>)klienci;
  48.             }
  49.             public List<Samolot> getSamoloty()
  50.             {
  51.                 return (List<Samolot>)samoloty;
  52.             }
  53.  
  54.         }
  55.         class Klient
  56.         {
  57.             private IList<Rezerwacja> rezerwacje;
  58.             public Klient()
  59.             {
  60.                 rezerwacje = new List<Rezerwacja>();
  61.             }
  62.  
  63.             public void dodajRezerwacje(Rezerwacja r)
  64.             {
  65.                 rezerwacje.Add(r);
  66.             }
  67.             public List<Rezerwacja> getRezerwacje()
  68.             {
  69.                 return (List<Rezerwacja>)rezerwacje;
  70.             }
  71.  
  72.         }
  73.         class KlientIndywidualny : Klient
  74.         {
  75.             protected string imie;
  76.             protected string nazwisko;
  77.             protected string PESEL;
  78.  
  79.             public KlientIndywidualny(string imie, string nazwisko, string PESEL) : base()
  80.             {
  81.                 this.imie = imie;
  82.                 this.nazwisko = nazwisko;
  83.                 this.PESEL = PESEL;
  84.             }
  85.         }
  86.             class PosrednikFirmy : KlientIndywidualny
  87.             {
  88.                 private string nazwa_firmy;
  89.                 private string KRS;
  90.  
  91.                 public PosrednikFirmy(string imie, string nazwisko, string PESEL, string nazwa_firmy, string KRS) : base(imie, nazwisko, PESEL)
  92.                 {
  93.                     this.nazwa_firmy = nazwa_firmy;
  94.                     this.KRS = KRS;
  95.                 }
  96.             }
  97.  
  98.         class Samolot
  99.         {
  100.             protected int liczba_miejsc;
  101.             protected double zasieg;
  102.             public Samolot(int liczba_miejsc,double zasieg)
  103.             {
  104.                 this.liczba_miejsc = liczba_miejsc;
  105.                 this.zasieg = zasieg;
  106.             }
  107.         }
  108.         class MalySamolot : Samolot
  109.         {
  110.             public MalySamolot(int liczba_miejsc, double zasieg) : base(liczba_miejsc, zasieg)
  111.             {
  112.                 this.liczba_miejsc = 100;
  113.                 this.zasieg = 1000;
  114.  
  115.             }
  116.         }
  117.         class SredniSamolot : Samolot
  118.         {
  119.             public SredniSamolot(int liczba_miejsc, double zasieg) : base(liczba_miejsc, zasieg)
  120.             {
  121.                 this.liczba_miejsc = 200;
  122.                 this.zasieg = 2000;
  123.             }
  124.         }
  125.         class DuzySamolot : Samolot
  126.         {
  127.             public DuzySamolot(int liczba_miejsc, double zasieg) : base(liczba_miejsc, zasieg)
  128.             {
  129.                 this.liczba_miejsc = 500;
  130.                 this.zasieg = 5000;
  131.             }
  132.         }
  133.        
  134.        
  135.         class Rezerwacja
  136.         {
  137.             protected string data_wylotu;
  138.             protected string data_powrotu;
  139.             protected string miejsce_wylotu;
  140.             protected string miejsce_przylotu;
  141.  
  142.             private IList<Lot> loty;
  143.             public Rezerwacja()
  144.             {
  145.                 loty = new List<Lot>();
  146.             }
  147.  
  148.             public void dodajLot(Lot l)
  149.             {
  150.                 loty.Add(l);
  151.             }
  152.             public List<Lot> getLoty()
  153.             {
  154.                 return (List<Lot>)loty;
  155.             }
  156.  
  157.         }
  158.         class Lot : Rezerwacja
  159.         {
  160.  
  161.             protected double odleglosc;
  162.             string typ_samolotu;
  163.             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)
  164.             {
  165.                 this.odleglosc = odleglosc;
  166.                 this.typ_samolotu = typ_samolotu;
  167.             }
  168.  
  169.  
  170.         }
  171.         class GeneratorLotow : Lot
  172.         {
  173.             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)
  174.             {
  175.             }
  176.  
  177.             public void dobierzSamolot()
  178.             {
  179.             }
  180.  
  181.             public void powielLot()
  182.             {
  183.  
  184.             }
  185.         }
  186.         static void Main(string[] args)
  187.         {
  188.             int wybor = 0;
  189.             do
  190.             {
  191.                 Console.WriteLine("Witamy w systemie rezerwacji biletow:");
  192.                 Console.WriteLine();
  193.                 Console.WriteLine("1 - Dodaj Lotnisko");
  194.                 Console.WriteLine("2 - Usun Lotnisko");
  195.                 Console.WriteLine("3 - Przeglad Lotnisk");
  196.                 Console.WriteLine("0 - Wyjdz z systemu");
  197.                 wybor = Int32.Parse(Console.ReadLine());
  198.                 SystemLotnisk slt = new SystemLotnisk();
  199.                 switch (wybor)
  200.                 {  
  201.                     case 1:
  202.                    
  203.                         break;
  204.                     case 2:
  205.  
  206.                         break;
  207.                     case 3:
  208.                        
  209.                         break;
  210.                 }
  211.             } while (wybor != 0);
  212.  
  213.  
  214.         }
  215.     }
  216. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement