GatoBooster

Compra

Mar 19th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Compra {
  3.    
  4.     static class Comprar{
  5.         String producto;
  6.         String fecha; //aammdd
  7.         int total;
  8.     }
  9.    
  10.     public static void main(String args[]) {
  11.         Scanner teclado = new Scanner(System.in);
  12.         Comprar carro[] = new Comprar[100];
  13.         String auxProducto, auxFecha;
  14.         int auxTotal;
  15.        
  16.         System.out.println("Ingrese producto");
  17.         auxProducto = teclado.nextLine();
  18.         System.out.println("Ingrese fecha");
  19.         auxFecha = teclado.nextLine();
  20.         System.out.println("Ingrese total");
  21.         auxTotal = teclado.nextInt();
  22.        
  23.         carro[0].producto = auxProducto;
  24.         carro[0].fecha = auxFecha;
  25.         carro[0].total = auxTotal;
  26.        
  27.         System.out.println("");
  28.         System.out.println("");
  29.         System.out.println("HOOOOLA");
  30.         System.out.println("ALO: "+carro[0].producto);
  31.     }
  32. }
Add Comment
Please, Sign In to add comment