Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 21, 2020 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/b89112266335b841592a73c6846f8206 to your computer and use it in GitHub Desktop.
Save parzibyte/b89112266335b841592a73c6846f8206 to your computer and use it in GitHub Desktop.
public static int solicitarIndice() {
Scanner sc = new Scanner(System.in);
System.out.println("Ingresa el número de producto: ");
return sc.nextInt();
}
public static Producto solicitarProducto() {
Scanner sc = new Scanner(System.in);
System.out.println("Ingresa descripción");
String descripcion = sc.nextLine();
System.out.println("Ingresa precio:");
double precio = sc.nextDouble();
return new Producto(precio, descripcion);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment