Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume that the class Agenda already exists, which provides the following method: add _ event that takes one parameter which is an Event object, and
Assume that the class Agenda already exists, which provides the following method:
addevent that takes one parameter which is an Event object, and returns True if the event was added to the agenda, False otherwise.
Assume that the class Event also already exists, which has na init method that takes three parameters:
A string name, which is the name of the event;
A string date, which the starting moment of the event;
A float duration, which is the duration of the event.
Finally, assume the variable agenda refers to an Agenda object. Write some code that prompts the user for the event parameters and adds the event to the agenda.
Note: Take a look at the following sample runs. Make sure the prompts and output format of your code is the same.
Note: You can safely assume the user will provide the correct type of input.
Sample Run User input enclosed in
In this case, addevent returns True
What is the event about:
When does the event start: : AM PST
How long is the event in hours:
"Meeting with John" added to the agenda.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started