Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.security.SecureRandom;
  3.  
  4. public class NumGenerator
  5. {
  6.  
  7. public static void main(String[] args)
  8. {
  9. int[] numArray = new int[10];
  10.  
  11. for ( int index = 0; index < numArray.length; index++)
  12. {
  13. numArray[index] = (int)(Math.random()*100);
  14. }
  15.  
  16. for ( int index = 0; index < numArray.length; index++)
  17. {
  18. System.out.println(numArray[index]);
  19. }
  20.  
  21. Scanner input = new Scanner(System.in);
  22.  
  23. System.out.println("Please enter a number between 0-100");
  24. int num = input.nextInt();
  25.  
  26. for ( int index = 0; index < numArray.length; index++)
  27. {
  28. if(numArray[index] > num)
  29. {
  30. System.out.println(numArray[index]);
  31. }
  32. }
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement