You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my opinion, the requirements for Cases03 and Cases06 are exactly the same. Only the type of task and the rough framework of the requirements change. The tasks do not offer any added value or any further challenge in which you have to use new aspects of Java.
Suggestion:
You could replace one of the two tasks with a task in which you have to use the ternary operator. This would show a new way of handling cases.
Task:
Develop a simple Java program that asks the user for a year and then checks whether this year is a leap year or not. Use the ternary operator for the check.
A leap year is defined as a year that is divisible by 4. Unless the year is divisible by 100, then it must also be divisible by 400 to be a leap year.
The program should perform the following steps:
Ask the user for a year.
Check whether the year entered is a leap year or not.
Output the result, whether it is a leap year or not.
Needs to be discussed ;)
The text was updated successfully, but these errors were encountered: