Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package switchonelu;
- /**
- *
- * @author Uko
- */
- public class Switchonelu {
- public static void main(String[] args){
- elu();
- }
- public static void elu(){
- int N;
- System.out.print("Sisesta number: ");
- N = TextIO.getlnInt();
- switch ( N ) { // (Assume N is an integer variable.)
- case 1:
- System.out.println("The number is 1.");
- break;
- case 2:
- case 4:
- case 8:
- System.out.println("The number is 2, 4, or 8.");
- System.out.println("(That's a power of 2!)");
- break;
- case 3:
- case 6:
- case 9:
- System.out.println("The number is 3, 6, or 9.");
- System.out.println("(That's a multiple of 3!)");
- break;
- case 5:
- System.out.println("The number is 5.");
- break;
- default:
- System.out.println("The number is 7 or is outside the range 1 to 9.");
- }
- }
- public static void Hooaeg(){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement