Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago