Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python programme question PY T HoN Programming Assignment 8 (50 points) Due date: March 7th, 2018 at 11:59 PM Overvievw This assignment provides practice with

image text in transcribedPython programme question

PY T HoN Programming Assignment 8 (50 points) Due date: March 7th, 2018 at 11:59 PM Overvievw This assignment provides practice with lists, classes, and functions in Python. Mailbox Class [50 points First, create a class called Message to model an e-mail message. The Message class has a recipient, a sender, and a message text as its basic data. This class will support that data with the following instance methods: -A constructor that initializes all members according to the passed parameters A method append that adds a line of text to the message body A method toString that makes the message into one long string like this: "From: Harry Morgan inTo: Rudolf Reindeerin..." Once defined, we will use it to instantiate Message objects that can be used in our main program. Second, create a class called Mailbox to store e-mail messages using the Message class. The Mailbox class stores a collection o messages. Implement the following methods: A constructor that constructs a new empty mailbox (use a list) A method addMessage that adds a new message to the mailbox. .A method getMessage that gets a message from the mailbox . A method removeMessage that returns the message in the mailbox at the provided index def addMessage (self, message) def getMessage (self, index) def removeMessage (self, index) Next, write a program that creates three instances of the Message class initialized with sample data. Then, create an instance of the Mailbox class. Name the source code files "Message.py", "Mailbox.py", and "MailboxDemo.py" Sample run: From: Bob To: Santa For Christmas, I would like: Video games World peace From: Bob To: Tooth Fairy Merry Christmas to my best friend I am wishing you blessings and joy this Christmas From: Bob To: Johnson Happy Thanksgiving to you and your family

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago