Skip to content

Instantly share code, notes, and snippets.

@RajatVaryani
Last active April 30, 2018 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RajatVaryani/33663bbd6eaa92e4c5296deffa9fc056 to your computer and use it in GitHub Desktop.
Save RajatVaryani/33663bbd6eaa92e4c5296deffa9fc056 to your computer and use it in GitHub Desktop.
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