Click Here to Chat on WhatsApp
+12709848396

This assignment focuses on if statements and indexing with sequential data types (in this case, indexing with strings).

 python project and need an explanation and answer to help me learn.

This assignment focuses on if statements and indexing with sequential data types (in this case, indexing with strings).
Alphie has created conversational agent named Cuthbert who can

Expert Answer

python project and need an explanation and answer to help me learn. This assignment focuses on if statements and indexing with sequential data types (in this case, indexing with strings). Alphie has created conversational agent named Cuthbert who can "talk" to the user, asking about baked goods. Alphie is quite proud of his program, but we might see some ways to improve it and some ways to extend it PART 1: use starter file (pdf but do on py) and try running it a couple times with varying inputs. Alter it so that the program only asks for foodChoice if the user says they want to eat Alter the foodChoice condition so that it does not need any or operators (hint: use the in operator) In addition to saying "Great news...", Cuthbert should also tell the user here how much the item costs and how many calories PART 2: Modify the program so that inflatedPrices is a list that contains all the values in the priceList Cuthbert should ask what the inflation percentage is, and then each of the prices in inflatedPrices should be multiplied by the inflation rate (e.g., if the inflation rate is 4%, multiply each element in inflatedPrices by 1.04) Modify the lines that set the two price total variables to 0. Instead, they should be the sum of the values in inflatedPrices list and priceList PART 3a: Modify the program so that if the user wants to add something to the menu, Cuthbert asks for the name of the food, the price and the calories and adds all this information to the respective lists Modify the program so that the totalPrices and totalCalories variables hold the correct values. PART 3b: Modify the program so that if the user wants to remove an item, Cuthbert asks for the name (not the index number) of the food to be removed. The name, price and calories for that food are then removed from the respective lists. Modify the program so that the totalPrices and totalCalories variables hold the correct values. You will submit a single Python (.py) file for this homework assignment. Be sure to include comments where appropriate. Requirements: as long as needed """ Name: Collaborators: COSC-010 Cuthbert Assignment Code adapted from an original program created by Alphie In this program, Cuthbert - a "baker bot" - has a conversation with the user. Cuthbert asks the user for information and then does some impressive calculations."""# By importing time library, the program can have pauses (in this case, to simulate "thinking")# We can also set a float variable, delay, to set how long each pause will be# - Set delay to 0.0 for testing or speed runs# - Set delay to larger numbers for dramatic effect. (2.0 = 2 seconds)import timedelay = 2.0foodList = ["muffin", "cookie", "scone", "cake"]priceList = [2.5, 2.0, 3.0, 25.0]calorieList = [510, 390, 460, 6500]print("Hi, I'm Cuthbert the Baker Bot!")# Each time we want a pause, the program can use the time.sleep() methodtime.sleep(delay)userName = input("What's your name? ")time.sleep(delay)eatOrNot = input("Hi, " + userName + "! Would you like to eat something? ")""" For Part 1..."""time.sleep(delay)foodChoice = input("Okay, what would you like to eat? ")time.sleep(delay)if foodChoice == foodList[0] or foodChoice == foodList[1] or foodChoice == foodList[2] or foodChoice == foodList[3]: print("Great news, " + userName + "! We have a " + foodChoice + " for you!")else: print("Sorry, " + userName + " - we do not have any " + foodChoice + " for you today.")""" For Part 2..."""time.sleep(delay)inflatedPrices = []print("Bad news. While we've been talking, inflation has made all the prices higher.")inflatedPricesTotal = 0originalPricesTotal = 0print("If you ate one of each item, your total would now be", inflatedPricesTotal, "dollars.")print("In the past, your total would have been", originalPricesTotal )""" For Part 3..."""time.sleep(delay)numItems = 0print("We currently have", numItems, "in our menu.")time.sleep(delay)newFoodOrNot = input("Would you like to add anything to the menu")print("We currently have", numItems, "in our menu.")totalPrices = 0totalCalories = 0time.sleep(delay)print("If you ate one of each item, it would cost", totalPrices, "dollars and be", totalCalories, "calories.")time.sleep(delay)print("Bon appetit!")

This question has already been tackled by one of our writers and a good grade recorded. You can equally get high grades by simply making your order for this or any other school assignment that you may have.

Every Student Buys Essays from us, here is why!

Pressed for time to complete assignments or when you feel like you cannot write, you can purchase an essay on our website. Some students also want model papers to use as samples when revising or writing. There are also students who approach our essay writing service to beat deadlines. We handle every type of homework, assignment, and academic writing tasks. You can buy college essays and other assignments here. At a glance, here are some reasons students prefer our website.

100% Original Essays and Papers

You can be sure that you are getting a paper that is custom written based on your instructions. We do not sell papers that are pre-written. Instead, we write every essay from scratch. When you say “write my essay,” we respond by giving you a paper that is 100% original and free of any plagiarism. The essays you purchase from us have never been sold anywhere.

Flexible & Affordable Prices

It does not cost a fortune to get academic writing help on our website. If you have a question from class, place an order, get a discount, and get cheap essay writing services. What you see as the price is what you pay for. There are no any hidden charges. If you need urgent papers, they might cost a little more, but the price is worth the quality you get in the end. Hire a professional academic writer beginning from $13 a page.

Anonymity, Privacy, and Confidentiality

No one will ever know that you purchased an essay or assignment from our website. The essays you buy from us are written by experts. Your data is only used to coordinate the essay writing services you get. No one can access your personal information and data. Go ahead and order an essay from our website. It is safe, secure, and convenient.

Order a Unique Copy of this Assignment
275 Words

By placing an order you agree to our terms of service

Place Order »