Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Kita2 {
- public static void main(String[] args) {
- System.out.println("enter the day in number:");
- Scanner s = new Scanner(System.in);
- int day = s.nextInt();
- /* the if style
- if (s==3)
- {
- System.out.println("Free day");
- }
- else if (s>=1 || s<=5)
- {
- System.out.println("working day");
- }
- else if (s>=6 && s<=7)
- {
- System.out.println("free day");
- }
- else
- {
- System.out.println("WTF?!?!?!?");
- }
- */
- switch (day) {
- case 1:
- case 2:
- case 4:
- case 5:
- System.out.println("working day");
- break;
- case 3:
- case 6:
- case 7:
- System.out.println("free day");
- break;
- default:
- System.out.println("WTF?!?!?");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement