{"id":608,"date":"2024-01-10T18:43:28","date_gmt":"2024-01-10T18:43:28","guid":{"rendered":"https:\/\/javigomez.org\/?p=608"},"modified":"2025-09-29T20:33:44","modified_gmt":"2025-09-29T20:33:44","slug":"u06-08-manejo-de-arrays-en-java-jj602","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2024\/01\/10\/u06-08-manejo-de-arrays-en-java-jj602\/","title":{"rendered":"U06-08-Manejo de arrays en Java (JJ602)"},"content":{"rendered":"\n<p>Pedir por pantalla cuantos alumnos hay y por cada uno hay que introducir el nombre y su nota. Preparar las siguientes funciones:<\/p>\n\n\n\n<p><em>notaMaxima<\/em><em>(<\/em><em>alumnos,notas<\/em><em>);<\/em><em> Se pasa un array con los alumnos y otro con las notas y muestra por pantalla el nombre del alumno que ha sacado la nota m\u00e1xima y su nota<\/em><\/p>\n\n\n\n<p><em>notaMinima<\/em><em>(<\/em><em>alumnos,notas<\/em><em>);<\/em><em> Se pasa un array con los alumnos y otro con las notas y muestra por pantalla el nombre del alumno que ha sacado la nota m\u00ednima y su nota<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package U6;\n\nimport java.util.Scanner;\n\npublic class JJ602 {\n\n\tpublic static void main(String&#91;] args) {\n\t      Scanner sc = new Scanner(System.in);\n\t      System.out.println(\"Cuantos n\u00fameros vas a escribir: \");\n\t      int n = sc.nextInt(); \n\t      String alumnos&#91;] = new String&#91;n];\n\t      int notas&#91;]=new int&#91;n];\n\t      for (int i = 0; i &lt; n; i++) {\n\t    \t  System.out.print(\"Nombre del alumno:\");\n\t    \t  alumnos&#91;i]=sc.next();\n\t    \t  \n\t          System.out.print(\"Introduzca la nota de \" + alumnos&#91;i] + \": \");\n\t          notas&#91;i] = sc.nextInt();\n\t       }\n\t      \n\t      notaMaxima(alumnos,notas);\n\t      notaMinima(alumnos,notas);\n    sc.close();\n\n\t}\n\t\n\t\n\tstatic void notaMaxima(String s&#91;],int t&#91;]) {\n\t\tint max=Integer.MIN_VALUE;\n\t\tint ind=0;\n\t\tfor (int i=0; i&lt;t.length;i++) \n\t\t\tif (t&#91;i]>max) {\n\t\t\t\tind=i;\n\t\t\t\tmax=t&#91;i];\n\t\t\t}\n\t\tSystem.out.println(s&#91;ind] + \" tiene la nota m\u00e1xima con un:\" + t&#91;ind]);\n\t}\n\tstatic void notaMinima(String s&#91;],int t&#91;]) {\n\t\tint min=Integer.MAX_VALUE;\n\t\tint ind=0;\n\t\tfor (int i=0; i&lt;t.length;i++) \n\t\t\tif (t&#91;i]&lt;min) {\n\t\t\t\tind=i;\n\t\t\t\tmin=t&#91;i];\n\t\t\t}\n\t\tSystem.out.println(s&#91;ind] + \" tiene la nota m\u00ednima con un:\" + t&#91;ind]);\n\t}\n\t\n\t\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Java U6 08 NotasMaxMin\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/lqOd52NXI3Q?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Pedir por pantalla cuantos alumnos hay y por cada uno hay que introducir el nombre y su nota. Preparar las siguientes funciones: notaMaxima(alumnos,notas); Se pasa &hellip; <\/p>\n","protected":false},"author":1,"featured_media":609,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[43,227,235],"class_list":["post-608","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-arrays","tag-maximo","tag-minimo"],"_links":{"self":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/comments?post=608"}],"version-history":[{"count":1,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/608\/revisions"}],"predecessor-version":[{"id":901,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/608\/revisions\/901"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media\/609"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}