import java.util.Scanner;
public class Main {
// SwitchExercises
public static void main
(String[] args
) { System.
out.
println("Enter week's day using a number"); Scanner scanner
= new Scanner
(System.
in); int dayOfWeek = scanner.nextInt();
switch (dayOfWeek) {
case 1:
weekTitle = "Monday";
break;
case 2:
weekTitle = "Tuesday";
break;
case 3:
weekTitle = "Wednesday";
break;
case 4:
weekTitle = "Thursday";
break;
case 5:
weekTitle = "Friday";
break;
case 6:
weekTitle = "Saturday";
break;
case 7:
weekTitle = "Sunday";
break;
default:
weekTitle = "Entered unknown item";
}
System.
out.
println(weekTitle
); scanner.close();
}
}
// if (dayOfWeek == 1) {
// weekTitle = "Monday";
// } else if (dayOfWeek ==2) {
// weekTitle = "Tuesday";
// } else if (dayOfWeek ==3) {
// weekTitle = "Wednesday";
// } else if (dayOfWeek ==4) {
// weekTitle = "Thursday";
// } else if (dayOfWeek ==5) {
// weekTitle = "Friday";
// } else if (dayOfWeek ==6) {
// weekTitle = "Saturday";
// } else if (dayOfWeek ==7) {
// weekTitle = "Sunday";
// } else {
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKcHVibGljIGNsYXNzIE1haW4gewoJLy8gU3dpdGNoRXhlcmNpc2VzCgkKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB7CgkJU3lzdGVtLm91dC5wcmludGxuKCJFbnRlciB3ZWVrJ3MgZGF5IHVzaW5nIGEgbnVtYmVyIik7CgkJU2Nhbm5lciBzY2FubmVyID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlpbnQgZGF5T2ZXZWVrID0gc2Nhbm5lci5uZXh0SW50KCk7CgkJU3RyaW5nIHdlZWtUaXRsZTsKCQkKCQlzd2l0Y2ggKGRheU9mV2VlaykgewoJCQljYXNlIDE6CgkJCQl3ZWVrVGl0bGUgPSAiTW9uZGF5IjsKCQkJCWJyZWFrOwoJCQljYXNlIDI6CgkJCQl3ZWVrVGl0bGUgPSAiVHVlc2RheSI7Cgk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