Write a program that replaces words in a sentence. The input begins with word replacement pairs (original and replacement). The next line of input is the sentence where any word on the original list is replaced.

6.19 LAB: Replacement words Write a program that replaces words in a sentence. The input begins with word replacement pairs (original and replacement). The next line of input is the sentence where any word on the original list is replaced. Ex: If the input is: automobile car manufacturer maker children kids The automobile manufacturer recommends car seats for children if the automobile doesn't already have one. the output is: The car maker recommends car seats for kids if the car doesn't already have one. You can assume the original words are unique.

6.19 LAB: Replacement words Write a program that replaces words in a sentence. The input begins with word replacement pairs (original and replacement). The next line of input is the sentence where any word on the original list is replaced. Ex: If the input is: automobile car manufacturer maker children kids The automobile manufacturer recommends car seats for children if the automobile doesn’t already have one. the output is: The car maker recommends car seats for kids if the car doesn’t a

Read More

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.

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

Read More

The student is allowed to rent 3 books for free: one e-book and 2 hard copy books. Once limit is reached, a thank you message will be displayed as shown below.

The student is allowed to rent 3 books for free: one e-book and 2 hard copy books. Once limit is reached, a thank you message will be displayed as shown below. If hardcopy book name starts with capital f (e.g. F), it's known to be fiction which is given price 40 SAR by default. Use only noargs constructors in creating objects in the Test class. Sample Run: Welcome to Alfaisal Bookstore! You are allowed 3 rentals Which e-book you want to rent? Hello pdf size is 5 MB You are allowed 2 rentals Which hardcopy book you want to rent? (F before book name indicates Fiction): FHello renting E books cost: 40.0 SAR You are allowed 1 rentals Which hardcopy book you want to rent? (F before book name indicates Fiction): FHi renting E books cost: 40.0 SAR Thanks for trying us.. You reached the limit of renting If 3rd input was empty, handle any possible exception: (Bonus 2%) Which hardcopy book you want to rent? (F before book name indicates Fiction): Warning.. Invalid Input Build a java program that has the following hierarchy of classes: Notes: Pdf side is randomly generated number between 0 and 1000 Hardcopy book name starting with "F" uses price method in fiction class (40 per item) Rental limit is decremented every time you rent a book

The student is allowed to rent 3 books for free: one e-book and 2 hard copy books. Once limit is reached, a thank you message will be displayed as shown below. If hardcopy book name starts with capital f (e.g. F), it’s known to be fiction which is given price 40 SAR by default. Use only noargs const

Read More

Read the two articles below that discuss why fuel prices fluctuate. Research two of these types further.  

Read the two articles below that discuss why fuel prices fluctuate. Research two of these types further.   2. Locate two JOURNAL articles which discuss this topic further. You need to focus on the Abstract, Introduction, Results, and Conclusion. For our purposes, you are not expected to fully understand the Data and Methodology.   3. Summarize these journal articles. Please use your own words. No copy-and-paste. Cite your sources.

Read More