Last active
April 30, 2018 16:09
-
-
Save RajatVaryani/33663bbd6eaa92e4c5296deffa9fc056 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Calendar; | |
//Discounter tells whether discount is applicable or not. | |
public class Discounter { | |
public boolean isDiscountApplicable() { | |
Calendar calendar = Calendar.getInstance(); | |
return calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY | |
&& calendar.get(Calendar.MONTH) != Calendar.DECEMBER; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment