Skip to content

Instantly share code, notes, and snippets.

@titandiaz
Created May 27, 2016 03:32
Show Gist options
  • Save titandiaz/06cfde391236069c7b1fae1eef9c4889 to your computer and use it in GitHub Desktop.
Save titandiaz/06cfde391236069c7b1fae1eef9c4889 to your computer and use it in GitHub Desktop.
parqueadero
import java.util.ArrayList;
public class parqueadero {
private ArrayList<Puesto> c;
public parqueadero()
{
c=new ArrayList<Puesto>();
for(int i = 0; i<7; i++)
{
c.add(new Puesto(10, 6, 20, "sdd"));
}
for(int i=0 ; i<c.size(); i++)
{
Puesto puesto=(Puesto) c.get( i);
System.out.println("puesto "+i+" = "+puesto.getValor()+ " " + puesto.gethEntrada() + " " + puesto.gethSalida() + " " + puesto.getCarro() );
}
}
public static void main(String[] args) {
parqueadero opc=new parqueadero();
}
}
*******************************************************************************************************************************
public class Puesto {
String placa;
int valor=0;
int hEntrada=0;
int hSalida=0;
public Puesto(int nValor, int nHEntrada, int nHSalida, String nPlaca)
{
placa= nPlaca;
valor=nValor;
hEntrada=nHEntrada;
hSalida=nHSalida;
}
public String getCarro() {
return placa;
}
public void setCarro(String placa) {
this.placa = placa;
}
public int getValor() {
return valor;
}
public void setValor(int valor) {
this.valor = valor;
}
public int gethEntrada() {
return hEntrada;
}
public void sethEntrada(int hEntrada) {
this.hEntrada = hEntrada;
}
public int gethSalida() {
return hSalida;
}
public void sethSalida(int hSalida) {
this.hSalida = hSalida;
}
public static void main(String[] args) {
}
}
*******************************************************************************************************************************
public class Carro {
String placa;
public String getPlaca() {
return placa;
}
public void setPlaca(String placa) {
this.placa = placa;
}
public static void main(String[] args) {
Carro opc=new Carro();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment