ASSIGNMENT 11 - SWITCH STATEMENT (DON'T NEED TO CREATE MANY IF STATEMENTS)
public class Practice{
public static void main(String[] args){
int speaker;
speaker = 5;
speaker = speaker - 5;
switch(speaker){
case 1:
System.out.println("You are a True Muslim");
break;
case 2:
System.out.println("You are not a True Muslim");
break;
case 3:
System.out.println("Are you a Muslim");
break;
case 4:
System.out.println("Yes, I am a Muslim");
break;
case 5:
System.out.println("I have interested in Islam");
break;
case 6:
System.out.println("I pray five times a day");
break;
default:
System.out.println("You have no $ense");
break;
}
}
}
public class Practice{
public static void main(String[] args){
int speaker;
speaker = 5;
speaker = speaker - 5;
switch(speaker){
case 1:
System.out.println("You are a True Muslim");
break;
case 2:
System.out.println("You are not a True Muslim");
break;
case 3:
System.out.println("Are you a Muslim");
break;
case 4:
System.out.println("Yes, I am a Muslim");
break;
case 5:
System.out.println("I have interested in Islam");
break;
case 6:
System.out.println("I pray five times a day");
break;
default:
System.out.println("You have no $ense");
break;
}
}
}
No comments:
Post a Comment