Question

Hello, I need help with writing this program out in Python. I use jGrasp for this problem as well any help will be appreciated.Programming Exercises 157 THON 18. Restaurant Selector You have a group of friends coming to visit for your high school reunion, and you want to take them out to eat at a local restaurant. You arent sure if any of them have dietary restrictions, but your restaurant choices are as follows: Joes Gourmet Burgers-Vegetarian: No, Vegan: No, Gluten-Free: No Main Street Pizza Company-Vegetarian: Yes, Vegan: No, Gluten-Free: Yes Corner Café-Vegetarian: Yes, Vegan: Yes, Gluten-Free: Yes Mamas Fine Italian-Vegetarian: Yes, Vegan: No, Gluten-Free: No The Chefs Kitchen-Vegetarian: Yes, Vegan: Yes, Gluten-Free: Yes Programing , Processing tion Structur etion Write a program that asks whether any members of your party are vegetarian, vegan, or gluten-free, to which then displays only the restaurants to which you may take the group ctons and ample of the programso and Tuples eAbcut Slrings anaries and eses and Is anyone in your party a vegetarian? yes Enter Is anyone in your party a vegan? no Enter Is anyone in your party gluten-free? yes Enter Here are your restaurant choices Programming curslcn Main Street Pizza Company Corner Cafe The Chefs Kitchen e here to search

0 0
Add a comment Improve this question Transcribed image text
Answer #1

'''
The restaurant list has been created as list of list.Every element is a
list with name vegetatrian,vegan and gluten free as attributes
'''

list = [["Joe's Gourmet Burgers","no", "no","no"],
        ["Main Street Pizza Company","yes", "no","yes"],
        ["Corner Cafe","yes", "yes","yes"],
        ["Mama's Fine Italian","yes", "no","no"],
        ["The Chef's Kitchen","yes", "yes","yes"]]

count = 0
inp1 = input("Is anyone in your party a vegetarian?(yes/no)")
if inp1=="yes":
   count = count + 1
inp2 = input("Is anyone in your party a vegan?(yes/no)")
if inp2=="yes":
   count = count + 1
inp3 = input("Is anyone in your party a gluten-free?(yes/no)")
if inp3=="yes":
   count = count + 1

choice = []
for i in range(len(list)):
      found = 0
      if inp1 == "yes":
         if list[i][1] == inp1:
            found = found + 1
      if inp2 == "yes":
         if list[i][2] == inp2:
            found = found + 1
      if inp3 == "yes":
         if list[i][3] == inp3:
            found = found + 1
      if count == found:
         choice.append(list[i][0])

if len(choice) > 0:
   print("Here are your restaurant choices:")
   for i in range(len(choice)):
        print(choice[i])
else:
   print("None of the resaturant seems applicable")

      

Add a comment
Know the answer?
Add Answer to:
Hello, I need help with writing this program out in Python. I use jGrasp for this...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hello, my name is Shady Slim. I understand you are going to help me figure out...

    Hello, my name is Shady Slim. I understand you are going to help me figure out my gross income for the year... whatever that means. It's been a busy year and I'm a busy man, so let me give you the lowdown on my life and you can do your thing I was unemployed at the beginning of the year and got $2,000 in unemployment compensation. I later got a job as a manager for Roca Cola. I earned $57,500...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT