PROGRAMACIÓN 2

Control de Clientes

class factura extends ejerciciofactura{

private int factura;
private String cliente;
private int subtotal;
private int iva;


public factura (int factura, String cliente, int subtotal, int iva) {
this.factura = factura;
this.cliente = cliente;
this.subtotal = subtotal;
this.iva = iva;

}

public int damefactura(){
return factura;
}
public String damenombre(){
return cliente;
}
public int damesubtotal(){
return subtotal;
}
public int dameiva(){
return iva;

}
}

class ejerciciofactura {
public static void main(String args[]) {

factura objeto1 = new factura(1230,"Carlos",200,15);
factura objeto2 = new factura(1231,"Cristina",350,50);
factura objeto3 = new factura(1232,"Mayra",420,70);
factura objeto4 = new factura(1233,"Martha",800,80);


System.out.println(" FACTURA " + "\t" + " CLIENTE " + "\t" + " SUBTOTAL " + "\t" + " IVA " + "\t" + " TOTAL ");
 
 System.out.println(" _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _" );

 
 System.out.println(objeto1.damefactura() + "\t" + objeto1.damenombre() + "\t" + objeto1.damesubtotal() + "\t" + objeto1.dameiva() + "\t" +
objeto1.damesubtotal() + objeto1.dameiva());

System.out.println(objeto2.damefactura() + "\t" + objeto2.damenombre() + "\t" + objeto2.damesubtotal() + "\t" + objeto2.dameiva() + "\t" +
objeto2.damesubtotal() + objeto2.dameiva());

System.out.println(objeto3.damefactura() + "\t" + objeto3.damenombre() + "\t" + objeto3.damesubtotal() + "\t" + objeto3.dameiva() + "\t" +
objeto3.damesubtotal() + objeto3.dameiva());

System.out.println(objeto4.damefactura() + "\t" + objeto4.damenombre() + "\t" + objeto4.damesubtotal() + "\t" + objeto4.dameiva() + "\t" +
objeto4.damesubtotal() + objeto4.dameiva());

System.out.println("\t" + "\t" + "\t" + "\t" + "\t" + "\t" + "\t" + "\t" + "\t" + "\t" +"\t" + "\t" + "\t" + "\t" + "\t" + "\t" + "  ¯¯¯¯¯¯");

System.out.println("\t" + "\t" + "\t" + "\t" + "\t" + "\t" + "\t" + "\t" + "\t" + "\t" +"\t" + "\t" + "\t" + "    TOTAL = " + (objeto1.damesubtotal()
+ objeto1.dameiva() + objeto2.damesubtotal() + objeto2.dameiva() + objeto3.damesubtotal() + objeto3.dameiva() + objeto4.damesubtotal() + objeto4.dameiva() ));

}
}