QUESTION GIVEN IN ATTACHMENT PLEASE SEE.   -----------AND PLEASE USE BELOW TEMPLATES ONLY WHILE MAKING SOLUTION----------- InvalidDateException.cpp #include using namespace std; class InvalidDateException: public exception{ //Fill your code here };   main.cpp #include #include #include "InvalidDateException.cpp" using namespace std; string* splitString(string str){ string* arr = new string[25]; int i=0; string delimiter = "/"; size_t pos = 0; string token; while ((pos = str.find(delimiter)) != string::npos) { token = str.substr(0, pos); arr[i]=token; str.erase(0, pos + delimiter.length()); i++; } arr[i]=str; return arr; } int main(){ //Fill your code here }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

QUESTION GIVEN IN ATTACHMENT PLEASE SEE.

 

-----------AND PLEASE USE BELOW TEMPLATES ONLY WHILE MAKING SOLUTION-----------

InvalidDateException.cpp

#include <exception>
using namespace std;
class InvalidDateException: public exception{
//Fill your code here
};

 

main.cpp

#include <iostream>
#include <exception>
#include "InvalidDateException.cpp"
using namespace std;
string* splitString(string str){
string* arr = new string[25];
int i=0;
string delimiter = "/";
size_t pos = 0;
string token;
while ((pos = str.find(delimiter)) != string::npos) {
token = str.substr(0, pos);
arr[i]=token;
str.erase(0, pos + delimiter.length());
i++;
}
arr[i]=str;
return arr;
}
int main(){
//Fill your code here
}

 

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
Transcribed Image Text: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
steps

Step by step

Solved in 6 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY