Answer to Question #285816 in Java | JSP | JSF for Sai

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


1
Expert's answer
2022-01-09T10:44:26-0500
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog