Write a complete Java Program to solve the following problem. February 18 is a special date as...

90.2K

Verified Solution

Question

Programming

Write a complete Java Program to solve the followingproblem.

February 18 is a special date as this is the date that can bedivisible by both 9 and 18

Write a program that asks the user for a numerical month andnumerical day of the month and then determines whether that dateoccurs before, after, or on February 18.

If the date occurs before February 18, output the word Before.If the date occurs after February 18, output the word After. If thedate is February 18, output the word Special.

Note: Passing the sample test cases are not enough to earn thefull marks. You need to test your program for different months anddates to see whether your program will work in all the cases.

Input

The input consists of two integers each on a separate line.These integers represent a date in 2015.
The first line will contain the month, which will be an integer inthe range from 1 (indicating January) to 12 (indicatingDecember).
The second line will contain the day of the month, which will be aninteger in the range from 1 to 31. You can assume that the day ofthe month will be valid for the given month.

Output

Exactly one of Before, After or Special will be printed on oneline.

Sample Input 1

17

Sample Output 1

Before

Sample Input 2

831

Sample Output 2

After

Sample Input 3

218

Sample Output 3

Special

Must be coded in java. Easy code for grade 11 class

Answer & Explanation Solved by verified expert
3.6 Ratings (655 Votes)
Code import    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students