Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6.  
  7. package switchonelu;
  8.  
  9. /**
  10. *
  11. * @author Uko
  12. */
  13. public class Switchonelu {
  14.  
  15. public static void main(String[] args){
  16. elu();
  17. }
  18.  
  19. public static void elu(){
  20. int N;
  21.  
  22. System.out.print("Sisesta number: ");
  23. N = TextIO.getlnInt();
  24.  
  25. switch ( N ) { // (Assume N is an integer variable.)
  26. case 1:
  27. System.out.println("The number is 1.");
  28. break;
  29. case 2:
  30. case 4:
  31. case 8:
  32. System.out.println("The number is 2, 4, or 8.");
  33. System.out.println("(That's a power of 2!)");
  34. break;
  35. case 3:
  36. case 6:
  37. case 9:
  38. System.out.println("The number is 3, 6, or 9.");
  39. System.out.println("(That's a multiple of 3!)");
  40. break;
  41. case 5:
  42. System.out.println("The number is 5.");
  43. break;
  44. default:
  45. System.out.println("The number is 7 or is outside the range 1 to 9.");
  46. }
  47. }
  48.  
  49. public static void Hooaeg(){
  50.  
  51.  
  52.  
  53. }
  54.  
  55.  
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement