In this program, you will create a personal organizer. Using parallel arrays, you will store the following information on each event in your organizer:
Month (1-12)
Day (1-31)
Year
Event name
If the user enters an invalid month (not 1-12), then the month should be set to January. If the user enters an invalid day (such as June 56th), then the day should be set to 1.
Declare the following arrays:
eventName: to store the event name
eventMonth: to store the event month
eventDay: to store the event day
eventYear: to store the event year
Write the following methods:
Add an event
Name it addEvent
Takes four parameters in the following order:
array of names
array of months
array of days
array of years
This function will ask the user for the event name, month, day, and year (in that order).
Next, it will append the name, month, day, and year to the appropriate array.
Invalid parameters should be stored as default.
Print all events
Name it printEvents
Takes four parameters in following order:
array of names
array of months
array of days
array of years
This function prints all events in the arrays in the specified format.
Print events in a specific month
Name it printMonth
Takes five parameters in following order:
selected month as integer
array of names
array of months
array of days
array of years
This function will print all events in the arrays in the specified format for the given month.
Your program should follow how the sample run shown below, including asks for input as well as how it outputs events.
It should first keep asking for new events to add until the user says NO. Then, it should print all the events entered. Finally, it should ask the user for a specific month that they would like to see events from.
Hint
Don't forget that not all months have 31 days.
Sample Run 1
What is the event: Hour of Code
What is the month (number): 12
What is the date: 5
What is the year: 2016
Do you want to enter another date? NO to stop. yes
What is the event: Winter Break Starts
What is the month (number): 12
What is the date: 15
What is the year: 2016
Do you want to enter another date? NO to stop. yes
What is the event: Taxes Due
What is the month (number): 4
What is the date: 15
What is the year: 2017
Do you want to enter another date? NO to stop. NO
******************** List of Events ********************
Hour of Code
Date: December 5, 2016
Winter Break Starts
Date: December 15, 2016
Taxes Due
Date: April 15, 2017
What month would you like to see? (Enter the month number)4
********** Events in April **********
Taxes Due
Date: April 15, 2017
Sample Output 1
******************** List of Events ********************
Hour of Code
Date: December 5, 2016
Winter Break Starts
Date: December 15, 2016
Taxes Due
Date: April 15, 2017
********** Events in April **********
Taxes Due
Date: April 15, 2017
Sample Run 2
What is the event: Hour of Code
What is the month (number): 12
What is the date: 5
What is the year: 2016
Do you want to enter another date? NO to stop. yes
What is the event: TESTING AN INVALID MONTH
What is the month (number): 14
What is the date: 3
What is the year: 2017
Do you want to enter another date? NO to stop. yes
What is the event: TESTING AN INVALID DATE
What is the month (number): 6
What is the date: 56
What is the year: 2015
Do you want to enter another date? NO to stop. yes
What is the event: Python Final Exam
What is the month (number): 6
What is the date: 4
What is the year: 2017
Do you want to enter another date? NO to stop. NO
******************** List of Events ********************
Hour of Code
Date: December 5, 2016
TESTING AN INVALID MONTH
Date: January 3, 2017
TESTING AN INVALID DATE
Date: June 1, 2015
Python Final Exam
Date: June 4, 2017
What month would you like to see? (Enter the month number)6
********** Events in June **********
TESTING AN INVALID DATE
Date: June 1, 2015
Python Final Exam
Date: June 4, 2017
Sample Output 2
******************** List of Events ********************
Hour of Code
Date: December 5, 2016
TESTING AN INVALID MONTH
Date: January 3, 2017
TESTING AN INVALID DATE
Date: June 1, 2015
Python Final Exam
Date: June 4, 2017
********** Events in June **********
TESTING AN INVALID DATE
Date: June 1, 2015
Python Final Exam
D
Answers
Answered by
0
Answer:
tied to a number please and your will do it yourself you can
Explanation:
uday PRAKASH is the first president to be MEETING or the 2
Similar questions