Advertisement
irishstorm

Untitled

Nov 4th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class ex7e
  4. {
  5. public static void main(String[] args)
  6. {
  7. Scanner input = new Scanner(System.in);
  8. char option;
  9.  
  10. do
  11. {
  12. System.out.print("Please enter a number : ");
  13. int num = input.nextInt();
  14. System.out.println();
  15.  
  16. if(num <= 10)
  17. {
  18. for(int i = 0; i < 7; i++)
  19. {
  20. System.out.println("Less than 10");
  21. }
  22. }
  23. else if( num >= 10)
  24. {
  25. for(int i = 0; i < 4; i++)
  26. {
  27. System.out.println("Greater than 10");
  28. }
  29. }
  30. System.out.print("Would you like to enter another number : y/n? ");
  31. option = input.next().charAt(0);
  32. System.out.println();
  33. }
  34. while(option == 'y' || option == 'Y');
  35.  
  36. System.out.print("Goodbye!");
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement