Answered step by step
Verified Expert Solution
Link Copied!

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:
add_event 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 1(User input enclosed in <>)
In this case, add_event returns True
What is the event about:
When does the event start: <02-15-202410:00 AM PST>
How long is the event (in hours): <1>
"Meeting with John" added to the agenda.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions