Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You own a restaurant in downtown Portland, Oregon. Here are the prices you charge per person for dinner: A person under the age of 6
You own a restaurant in downtown Portland, Oregon. Here are the prices you charge per person for dinner: A person under the age of 6 can get the child's meal price of $3. For a person at least 6 years old but not legally an adult yet (age 18 in the United States), the price is $10. For adults at least 18 but under the age of 65, the price is $20, unless the person lives in Oregon ('OR') or Washington ('WA'). For adults who live in those states only, the price is $18. Senior citizens age 65 and older can buy their meal for $15, regardless of where they live. If the person is an adult or senior who is currently a school teacher, then $2 is subtracted from the meal price as an extra educator discount. Write branching statements (e.g., if, if-else, if-elif, etc.) that assign to the variable price the correct meal cost according to the conditions given above. You may assume the variable named age (type is double), home state (type is string), and teacher (type is boolean, so True or False) already contain the necessary values before entering your code. Examples: age = 21; home_state OR', teacher = False means price will be 18 age 70; home state = 'CA'; teacher True means price will be 13 age = 12; home state 'WA's teacher = False means price will be 10 Put your branching code in the box below. It will be tested by the grader, so it should be executable
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started