Preview:
public class Surtidor {
    
    public int id;
    public int cantidadActual;
    public double facturado;
    public ArrayList<Operacion> operaciones;
    
    public Surtidor(int id) {
        this.id=id;
        cantidadActual=100000;
        facturado=0.0;
        operaciones=new ArrayList<>();
    }
    
    public void echarGasolina(Empleado e,int cantidad,Auto a) {
        operaciones.add(new Operacion(e,cantidad));
        cantidadActual-=cantidad;
        a.cantidadActual+=cantidad;
        facturado+=(cantidad*1000);
    }
    
    @Override
    public String toString() {
        String cadena=" Sutidor "+id+" tiene "+cantidadActual+" y "
                + "facturado:"+facturado+"\n";
        cadena+=" Las operaciones son: \n";
        for(int i=0; i < operaciones.size(); i++)
            cadena+=operaciones.toString();
        
        return cadena;
    }
    
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter