Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
ClientesJava v2
import java.util.Scanner; class Cliente { String nombre; String apellido; int nroCliente; Cliente(String n,String a,int nc) { this.nombre=n; this.apellido=a; this.nroCliente=nc; } void infoCliente(){ System.out.println("Cliente "+this.nroCliente+", Nombre: "+this.nombre+", Apellido: "+this.apellido); } } class Main{ public static void main(String args[]){ Scanner s=new Scanner(System.in); Cliente c[]=new Cliente[10]; int i=0; int opc; int nCliente; do{ System.out.print("Ingrese el Nombre: "); String nombre=s.nextLine(); System.out.print("Ingrese el Apellido: "); String apellido=s.nextLine(); System.out.print("Ingrese el Numero de Cliente: "); nCliente=s.nextInt(); c[i]=new Cliente(nombre,apellido,nCliente); System.out.print("Ingrese -1 para dejar de registrar Clientes: "); opc=s.nextInt(); if(opc==-1){ break; } else{ i++; } s.nextLine(); }while(opc!=-1); for(int j=0;j<=i;j++){ c[j].infoCliente(); } } }
run
|
edit
|
history
|
help
0
1a
Just numbers
hello_world_test
java.
Roberto02
Game developer
Day 2
Leetcode 17. Letter Combinations of a Phone Number
Quadratic equation
Binary Tree Max path Sum