Question #285816

University has restricting those students having odd roll numbers in the campus on Monday, Wednesday, and friday and for those students having even roll number on Tuesday, Thursday and saturday. Demonstrate the scenario by completing the following code snippet that will inform to the students on which day he/she can come to the campus


Expert's answer

public class Main {
    public void check(int rollNumber) {
        if (rollNumber % 2 != 0) {
            System.out.println("Monday, Wednesday, and Friday");
        } else {
            System.out.println("Tuesday, Thursday and Saturday");
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS