InvalidDateException An event management company needs to keep track of all the events they organize in the year 2017. They have the dates in which all the events that had happened in the whole year. You are the technical head of the company write a program to check whether the entered date is valid and find the count of events for each quarter for the year 2017. The program asks for dates as input. If the date is not valid it prints an error message. Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. The class named InvalidDateException inherits the exception class and includes a member function that returns the following message "InvalidDateException: Please enter the date again".   In the Main method, obtain the number of events from the user in the console. Get the date for each event. If the date is invalid, throw InvalidDateException and ask the user to enter the date again. After getting the valid date for all the events, display the count of events in all quarters.   Assumption The date is valid if 1<= day<=31, 1<= month<=12 and  year = 2017   Input and Output Format Refer sample input and output for formatting specifications.   [All text in bold corresponds to the input and the rest corresponds to output.]   Sample Input/Output Enter the number of events                                                                                             3                                                                                                                      Enter the date of event 1 in dd/mm/yyyy format                                                                        12/12/2017                                                                                                             Enter the date of event 2 in dd/mm/yyyy format                                                                        12/15/2017                                                                                                             InvalidDateException:Please enter the date again                                                                       Enter the date of event 2 in dd/mm/yyyy format                                                                        32/02/2017                                                                                                             InvalidDateException:Please enter the date again                                                                       Enter the date of event 2 in dd/mm/yyyy format                                                                        12/02/2017                                                                                                             Enter the date of event 3 in dd/mm/yyyy format                                                                        04/07/2015                                                                                                             InvalidDateException:Please enter the date again                                                                       Enter the date of event 3 in dd/mm/yyyy format                                                                        04/07/2017                                                                                                             Number of events in first quarter: 1                                                                                   Number of events in second quarter: 0                                                                                  Number of events in third quarter: 1                                                                                   Number of events in fourth quarter: 1

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 12PE
icon
Related questions
Question
InvalidDateException

An event management company needs to keep track of all the events they organize in the year 2017. They have the dates in which all the events that had happened in the whole year. You are the technical head of the company write a program to check whether the entered date is valid and find the count of events for each quarter for the year 2017. The program asks for dates as input. If the date is not valid it prints an error message.

Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.

The class named InvalidDateException inherits the exception class and includes a member function that returns the following message "InvalidDateException: Please enter the date again".
 
In the Main method, obtain the number of events from the user in the console. Get the date for each event. If the date is invalid, throw InvalidDateException and ask the user to enter the date again. After getting the valid date for all the events, display the count of events in all quarters.
 
Assumption
The date is valid if 1<= day<=31, 1<= month<=12 and  year = 2017
 
Input and Output Format
Refer sample input and output for formatting specifications.
 
[All text in bold corresponds to the input and the rest corresponds to output.]
 
Sample Input/Output
Enter the number of events                                                                                            
3                                                                                                                     
Enter the date of event 1 in dd/mm/yyyy format                                                                       
12/12/2017                                                                                                            
Enter the date of event 2 in dd/mm/yyyy format                                                                       
12/15/2017                                                                                                            
InvalidDateException:Please enter the date again                                                                      
Enter the date of event 2 in dd/mm/yyyy format                                                                       
32/02/2017                                                                                                            
InvalidDateException:Please enter the date again                                                                      
Enter the date of event 2 in dd/mm/yyyy format                                                                       
12/02/2017                                                                                                            
Enter the date of event 3 in dd/mm/yyyy format                                                                       
04/07/2015                                                                                                            
InvalidDateException:Please enter the date again                                                                      
Enter the date of event 3 in dd/mm/yyyy format                                                                       
04/07/2017                                                                                                            
Number of events in first quarter: 1                                                                                  
Number of events in second quarter: 0                                                                                 
Number of events in third quarter: 1                                                                                  
Number of events in fourth quarter: 1
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT