AppVeinteNum - num=(int)(Math.random()*(m+1)); numgen+= num...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import*; i public class AppVeinteNum{ p public static BufferedReader entrada = new BufferedReader(new InputStreamReader(; public static PrintWriter salida = new PrintWriter(System.out, true); p public static void main(String args[]) throws IOException{ p System.out.println(" « inicio de la aplicación »\n"); S String user = ""; int m, k; i do{ String numgen = ""; int num, menk, igk, mayk; num = menk = igk = mayk = 0; n salida.print("\nIngresa un número máximo: "); salida.flush(); m = Integer.parseInt(entrada.readLine()); m salida.print("Ingresa un número a comparar: "); salida.flush(); k = Integer.parseInt(entrada.readLine()); k for(int i=1; i<=20; i++){
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: num=(int)(Math.random()*(m+1)); numgen+= num + &quot; &quot;; if(num&gt;k) mayk++; else if(num&lt;k) menk++; else igk++;} e salida.println(&quot;\n &amp; Nmeros generados aleatoriamente: &quot;+numgen); salida.println(&quot; . Rango: 0 &lt;-&gt; &quot;+m+&quot;.&quot;); salida.println(&quot; &amp; La cantidad de nmero menores a &quot;+k+&quot;: &quot;+menk); salida.println(&quot; &amp; La cantidad de nmero iguales a &quot;+k+&quot;: &quot;+igk); salida.println(&quot; &amp; La cantidad de nmero mayores a &quot;+k+&quot;: &quot;+mayk); &quot; salida.println(&quot;\n / Deseas inciar de nuevo? (s/no)&quot;); user = entrada.readLine(); }while(user.toLowerCase().equals(&quot;si&quot;)); } System.out.println(&quot;\n fin de la aplicacin &quot;); S } }...
View Full Document

Ask a homework question - tutors are online