Waived!

In this task, we’re going to be simulating an email message. Some of the logic has been filled out for you in the email.py file.

(2 customer reviews)

Original price was: $27.00.Current price is: $20.00.

Download button will appear immediately after successful payment.

Book your next exam with us and get A+ in entire semester, guaranteed!

View Details
Solved By Verified
Study Co-Pilot All Study Co-Pilots are evaluated by Gotit Pro as an expert in their subject area.
Instant
Download

Description

In this task, we’re going to be simulating an email message. Some of the logic has been filled out for you in the email.py file. ● Open the file called email.py. ● Create a class definition for an Email which has four variables: has_been_read, email_contents, is_spam and from_address. ● The constructor should initialise the sender’s email address. ● The constructor should also initialise has_been_read and is_spam to false. ● Create a function in this class called mark_as_read which should change has_been_read to true. ● Create a function in this class called mark_as_spam which should change is_spam to true. ● Create a list called inbox to store all emails (note that you can have a list of objects).   Then create the following methods: ○ add_email - which takes in the contents and email address from the received email to make a new Email object. ○ get_count - returns the number of messages in the store. ○ get_email - returns the contents of an email in the list. For this, allow the user to input an index i.e. get_email(i) returns the email stored at position i in the list. Once this has been done, has_been_read should now be true. ○ get_unread_emails - should return a list of all the emails that haven’t been read. ○ get_spam_emails - should return a list of all the emails that have been marked as spam. ○ delete - deletes an email in the inbox. Now that you have these set up, let’s get everything working! ● Fill in the rest of the logic for what should happen when the user inputs send/read/quit. Some of it has been done for you.

In this task, we’re going to be simulating an email message. Some of the logic has been filled out for you in the email.py file.

● Open the file called email.py.
● Create a class definition for an Email which has four variables: has_been_read, email_contents, is_spam and from_address.
● The constructor should initialise the sender’s email address.
● The constructor should also initialise has_been_read and is_spam to false.
● Create a function in this class called mark_as_read which should change has_been_read to true.
● Create a function in this class called mark_as_spam which should change is_spam to true.
● Create a list called inbox to store all emails (note that you can have a list of objects).

 

Then create the following methods:

○ add_email – which takes in the contents and email address from the received email to make a new Email object.
○ get_count – returns the number of messages in the store.
○ get_email – returns the contents of an email in the list. For this, allow the user to input an index i.e. get_email(i) returns the email stored at position i in the list. Once this has been done, has_been_read should now be true.
○ get_unread_emails – should return a list of all the emails that haven’t been read.
○ get_spam_emails – should return a list of all the emails that have been marked as spam.
○ delete – deletes an email in the inbox.

Now that you have these set up, let’s get everything working!
● Fill in the rest of the logic for what should happen when the user inputs send/read/quit. Some of it has been done for you.


2 reviews for In this task, we’re going to be simulating an email message. Some of the logic has been filled out for you in the email.py file.

  1. Frank Cory

    Expert did a fantastic job on the assignment

  2. Julie Redd

    Amazing expert with great feedback and was able to assist with project I needed by the deadline

Only logged in customers who have purchased this product may leave a review.


You may also like…

Patron Details

Additional information

Your Solution

Product
Quantity
Total
Cart Subtotal $0.00
Order Total $0.00

  • Pay with your credit card.