using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lab4Zad1Samochód
{
public class Garaz{
private String adres;
private int pojemnosc;
private int liczbaSamochodow = 0;
private Samochod[] samochody;
public String Adres{
get { return adres; }
set { adres = value; }
}
public int Pojemnosc{
get { return pojemnosc; }
set {
pojemnosc = value;
samochody = new Samochod[pojemnosc];
}
}
public Garaz(){
adres = "nieznany";
pojemnosc = 0;
samochody = null;
}
public Garaz(string adres_, int pojemnosc_){
adres = adres_;
pojemnosc = pojemnosc_;
samochody = new Samochod[pojemnosc_];
}
public void WprowadzSamochod(Samochod samochod_){
if (liczbaSamochodow < pojemnosc)
{
samochody[liczbaSamochodow] = samochod_;
liczbaSamochodow++;
}
else
{
Console.WriteLine("Garaż jest zapełniony.");
}
}
public Samochod WyprowadzSamochod(){
if (liczbaSamochodow == 0)
{
Console.WriteLine("Garaż jest pusty.");
return new Samochod();
}
else
{
int tmp = samochody[liczbaSamochodow - 1];
samochody[liczbaSamochodow - 1] = null;
liczbaSamochodow--;
return tmp;
}
}
public void WypiszInfo(){
Console.WriteLine("Adres garażu : " + adres);
Console.WriteLine("Pojemność garażu : " + pojemnosc);
for (int i = 0; i < liczbaSamochodow; i++)
{
samochody[i].WypiszInfo();
}
}
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}