public Estacionamiento(decimal elPrecio, int cantidadDeCocheras) { //PrecioDeUso = elPrecio; cocheras = new Cochera[cantidadDeCocheras]; for (int i = 0; i < cantidadDeCocheras; i++) { Cochera nuevaCochera = new Cochera(); cocheras[i] = nuevaCochera; } }
public Cochera BuscarCocheraDisponible() { Cochera res = null; for (int i = 0; i < cocheras.Length; i++) { if (cocheras[i].estaDisponible() == true) { res = cocheras[i]; break; } } return(res); }