Write a Python program for an online MoonBucks coffee order. Coffee is sold by the pound, and the price per pound

Write a Python program for an online MoonBucks coffee order. Coffee is sold by the pound, and the price per pound depends upon the quantity ordered according to the table shown below. Partial pounds are not sold. Shipping is $1.00 per pound, but free for coffee orders over $150 before tax. The user must enter the number of pounds desired from the keyboard. The program will then display the cost of the coffee, the 7% sales tax, shipping charges (if any) and the total amount due. All four values should be displayed in currency format with the $ sign right up against the first digit. See SAMPLE OUTPUTS below. MoonBucks Coffee Company - Coffee Prices 40 pounds or more $7.50 per lb. 20 pounds or more $8.75 per lb. 10 pounds or more $10.00 per lb. 1 to 9 pounds $12.00 per lb. Start with a comment that includes your name and course number. Include pseudocode that describes all steps required to solve the problem. Employ variable names that describe the values they store and adhere to Python naming conventions. Include additional comments as needed to annotate your code. Use correct spelling and grammar. SAMPLE OUTPUT How many pounds are you ordering? 15 Cost of coffee $150.00 7% sales tax $10.50 Shipping fee $15.00 Total payable $175.50 SAMPLE OUTPUT How many pounds are you ordering? 50 Cost of coffee $375.00 7% sales tax $26.25 Shipping fee $0.00 Total payable $401.25

Write a Python program for an online MoonBucks coffee order. Coffee is sold by the pound, and the price per pound depends upon the quantity ordered according to the table shown below. Partial pounds are not sold. Shipping is $1.00 per pound, but free for coffee orders over $150 before tax. The user must enter the number of pounds desired from the keyboard. The program will then display the cost of the coffee, the 7% sales tax, shipping charges (if any) and the total amount due. All four values s

Read More

Write Python code to compute the value of the Boolean expression that checks whether a point with coordinates (5, 5) is inside a circle with center (0,0) and radius 7.

Write Python code to compute the value of the Boolean expression that checks whether a point with coordinates (5, 5) is inside a circle with center (0,0) and radius 7.

Write Python code to compute the value of the Boolean expression that checks whether a point with coordinates (5, 5) is inside a circle with center (0,0) and radius 7.

Read More

Define a function trophiclevelindex(chla , tn, tp) that takes values for Chorophyll-a (CHLA), Total Nitrogen (TN), and Total Phosphorus (TP) and returns the Trophic Index (TLI3) using the calculation below.

Define a function trophic_level_index(chla , tn, tp) that takes values for Chorophyll-a (CHLA), Total Nitrogen (TN), and Total Phosphorus (TP) and returns the Trophic Index (TLI3) using the calculation below. The TLI3 is calculated as the average of the three transformed values, where each value is transformed as follows: tlc = 2.22 + 2.54 ∗ log10​CHLA tln = −3.61 + 3.01 ∗ log10​TN tlp = 0.218 + 2 .92 ∗ log10​TP ​For example, if CHLA = 10, TN = 100, and TP = 1000, then: tlc = 2.22 + 2.54 ∗ 1 = 4.76 tln = −3.61 + 3.01 ∗ 2 = 2.410 tlp = 0.218 + 2.92 ∗ 3 = 8.978 and TLI3 = 5.383 (to 3 decimal places) Notes: - The notation log10​x means the logarithm to base 10 of x, i.e. the power to which 10 must be raised to yield x. - In Python, log10​x can be calculated (after importing the math module) as math.log(x, 10) - You can assume that CHLA, TN, and TP values are positive, i.e. greater than 0. - Your function should not round its result. - TN, TP, and CHLA are commonly used variable names in the literature, so you can use the following variable names in your code in this assignment: tn, tp, and chla (note they are lower case).

Define a function trophic_level_index(chla , tn, tp) that takes values for Chorophyll-a (CHLA), Total Nitrogen (TN), and Total Phosphorus (TP) and returns the Trophic Index (TLI3) using the calculation below. The TLI3 is calculated as the average of the three transformed values, where each value is transformed as follows: tlc = 2.22 + 2.54 ∗ log10​CHLA tln = −3.61 + 3.01 ∗ log10​TN tlp = 0.218 + 2 .92 ∗ log10​TP ​For example, if CHLA = 10, TN = 100, and TP = 1000, then: tlc = 2.22 + 2.54 ∗ 1 =

Read More

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