Codigos java (tud-down)
public class corrida {
public static void main(String[] args) {
//DECLARO LAS VARIABLES
String nombre;
int boletos;
int costoBoletos=3500;
int Apagar;
doubleimputuri= 0.10;
double impuVenta= 0.13;
//PIDO EL NOMBRE DE LA PERSONA QUE VA A COMPRAR LOS BOLETOS
//PARA HACERLO MÁS PERSONALIZADO
nombre= JOptionPane.showInputDialog("Digite su nombre");
// IMPRIMOEL NOMBRE DE LA PERSONA, SALUDANDO ;)
JOptionPane.showMessageDialog(null, "Estimado "+nombre+" , el boleto tiene un costo de
¢3500");
//LE PIDO AL UDUARIO CUANTOS BOLETOS VA A COMPRAR
boletos=Integer.parseInt(JOptionPane.showInputDialog(null, "¿Cuantos boletos desea
comprar?"));
// CALCULO EL PRECIO DE LOS BOLETOS SIN EL IMPUESTO DE VENTA
Apagar= boletos*costoBoletos;
// IMPRIMO ELPRECIO DEL TOTAL DE BOLETOS A COMPRAR
JOptionPane.showMessageDialog(null, "El total a pagar por los boletos sin impuestos es de:
¢"+Apagar);
double total;
// CALCULO EL TOTAL CON LOS IMPUESTO YLUEGO LE DIGO AL USUARIO EL TOTAL DE TODO
total= Apagar+(Apagar*imputuri)+(Apagar*impuVenta);
JOptionPane.showMessageDialog(null, "Se le sumaran el 10% del impuesto de turismo y
"+"\n"
+" un 13% delimpuesto de venta");
JOptionPane.showMessageDialog(null, "El total a pagar con los impuestos es de ¢"+total);
JOptionPane.showMessageDialog(null, "Gracias por su compra"+"\n"+
"¡Disfrute suviaje!");
}
}
//--------------------------------------------parte2----------------------------------------------------------------
import javax.swing.JOptionPane;
public class corrida {
publicstatic void main(String[] args)
{
String nombre;
int a,b,c,d;
nombre=JOptionPane.showInputDialog("¿como te llamas?");
JOptionPane.showMessageDialog(null, "Hola "+nombre );
int envas;
int cantiml;envas=Integer.parseInt(JOptionPane.showInputDialog("¿cuantos en vases compraste?"));
JOptionPane.showMessageDialog(null, "¡por favor ingresa las cantidades para los envases en
mililitros!");...
Regístrate para leer el documento completo.