terrasuzuki

La wea fome que impakto al otro weon

May 26th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.79 KB | None | 0 0
  1. public class Main {
  2. public static ArrayList<SeleccionFutbol> integrantes = new ArrayList<SeleccionFutbol>();
  3. public static void main(String[] args) {
  4. Scanner sc=new Scanner (System.in);
  5. int i=1,opc=0;
  6. SeleccionFutbol Ent1 = new Entrenador();
  7. SeleccionFutbol Fut1 = new Futbolista();
  8. SeleccionFutbol Mas = new Masajista();
  9. while(opc!=9){
  10. System.out.println("Menu: ");
  11. System.out.println("1.) Capturar Datos: ");
  12. System.out.println("2.) Datos De Concentracion: ");
  13. System.out.println("3.) Datos De Viaje: ");
  14. System.out.println("4.) Datos De entenamiento: ");
  15. System.out.println("5.) Datos De Partido De Futbol: ");
  16. System.out.println("6.) Datos De La Planificacion Del Entrenamiento: ");
  17. System.out.println("7.) Datos De Entrevista: ");
  18. System.out.println("8.) Datos De Dar Masaje: ");
  19. System.out.println("9.) Salir: ");
  20. opc=sc.nextInt();
  21. switch(opc){
  22. case 1:{
  23. System.out.println("Ingrese Datos De Entrenador: ");
  24. try{
  25. System.out.println("Ingrese Id: ");
  26. Ent1.setId(sc.nextInt());
  27.  
  28. }catch(InputMismatchException e ){
  29. System.out.println("Debe ingresar solo numeros enteros...");
  30. }
  31. }
  32. System.out.println("Ingrese Nombre: ");
  33. Ent1.setNombre(sc.next());
  34. System.out.println("Ingrese Apellido: ");
  35. Ent1.setApellidos(sc.next());
  36. System.out.println("Ingrese Edad: ");
  37. Ent1.setEdad(sc.nextInt());
  38. System.out.println("Ingrese Codigo De Federacion: ");
  39. ((Entrenador)Ent1).setIdFederacion(sc.next());
  40.  
  41. System.out.println("Ingresar Cantidad De Futbolistas: ");
  42. int x=0;
  43. x=sc.nextInt();
  44. for(i=1;i<=x;i++){
  45. System.out.println("Ingrese Datos De Futbolista: "+" ");
  46.  
  47. try{
  48. System.out.print("Ingrese Id: "+" ");
  49. Fut1.setId(sc.nextInt());
  50.  
  51. }catch(InputMismatchException e ){
  52. System.out.println("Debe ingresar solo numeros enteros...");
  53. }
  54. }
  55. System.out.print("Ingrese Nombre: "+" ");
  56. Fut1.setNombre(sc.next());
  57. System.out.print("Ingrese Apellido: "+" ");
  58. Fut1.setApellidos(sc.next());
  59. System.out.print("Ingrese Edad: "+" ");
  60. Fut1.setEdad(sc.nextInt());
  61. System.out.print("Ingrese Demarcacion: "+" ");
  62. ((Futbolista)Fut1).setDemarcacion(sc.next());
  63. System.out.print("Ingrese Dorsal: "+" ");
  64. ((Futbolista)Fut1).setDorsal(sc.nextInt());
  65. }
  66.  
  67. System.out.println("Ingrese Datos Del Masajista: ");
  68. System.out.println("Ingrese Id: ");
  69. Mas.setId(sc.nextInt());
  70. System.out.println("Ingrese Nombre: ");
  71. Mas.setNombre(sc.next());
  72. System.out.println("Ingrese Apellido: ");
  73. Mas.setApellidos(sc.next());
  74. System.out.println("Ingrese Edad: ");
  75. Mas.setEdad(sc.nextInt());
  76. System.out.println("Ingrese Profesion: ");
  77. ((Masajista )Mas).setTitulacion(sc.next());
  78. System.out.println("Años De Experiencia: ");
  79. ((Masajista)Mas).setAniosExperiencia(sc.nextInt());
  80.  
  81. integrantes.add(Ent1);
  82. integrantes.add(Fut1);
  83. integrantes.add(Mas);
  84.  
  85. break;
  86. }
  87. case 2:{
  88. System.out.println("Todos los integrantes comienzan una concentracion.");
  89.  
  90. for (SeleccionFutbol integrante : integrantes) {
  91. System.out.print(integrante.getNombre()+" "+integrante.getApellidos()+" -> ");
  92. integrante.Concentrarse();
  93. }
  94. break;
  95.  
  96. }
  97. case 3:{
  98. System.out.println("\nTodos los integrantes viajan para jugar un partido...");
  99.  
  100. for (SeleccionFutbol integrante : integrantes){
  101. System.out.print(integrante.getNombre()+" "+integrante.getApellidos()+" -> ");
  102. integrante.Viajar();
  103. }
  104. break;
  105. }
  106. case 4:{
  107. System.out.println("\nEntrenamiento: Todos los integrantes tienen su función en un entrenamiento");
  108.  
  109. for (SeleccionFutbol integrante : integrantes) {
  110. System.out.print(integrante.getNombre() + " " + integrante.getApellidos() + " -> ");
  111. integrante.entrenamiento();
  112. }
  113. break;
  114. }
  115. case 5:{
  116. System.out.println("\nPartido de Fútbol: Todos los integrantes tienen su función en un partido");
  117.  
  118. for (SeleccionFutbol integrante : integrantes) {
  119. System.out.print(integrante.getNombre() + " " + integrante.getApellidos() + " -> ");
  120. integrante.partidoFutbol();
  121. }
  122. break;
  123. }
  124. case 6:{
  125. System.out.println("\nPlanificar Entrenamiento: Solo el entrenador tiene el método para planificar un entrenamiento:");
  126.  
  127. System.out.print(Ent1.getNombre() + " " + Ent1.getApellidos() + " -> ");
  128. ((Entrenador) Ent1).planificarEntrenamiento();
  129. }
  130. break;
  131. case 7:{
  132. System.out.println("\nEntrevista: Solo el futbolista tiene el método para dar una entrevista:");
  133.  
  134. System.out.print(Fut1.getNombre() + " " + Fut1.getApellidos() + " -> ");
  135. ((Futbolista) Fut1).entrevista();
  136. }
  137. break;
  138. case 8:{
  139. System.out.println("\nMasaje: Solo el masajista tiene el método para dar un masaje:");
  140.  
  141. System.out.print(Mas.getNombre() + " " + Mas.getApellidos() + " -> ");
  142. ((Masajista) Mas).darMasaje();
  143. }
  144. break;
  145.  
  146. }
  147. }
  148. }
  149. }
Advertisement
Add Comment
Please, Sign In to add comment