Computer Science, asked by wasimkhan09099, 5 months ago

Write a program to press b for burger and it's price

Answers

Answered by abid8255
0

Answer:

Ingredient

'B' stands for a piece of bun

"C stands for cheese

'P stands for patty

V stands for veggies

"O stands for onions

'M' stands for mushroom

Price

$5

$8

$9

$6

$5

$7

While the customer has the option to mix and match any ingredient to customize the burger as per their wishes, every

burger MUST have two buns (one on top and one at the bottom). Eg. BPVBPVCB

==

==

def burgerPrice(burger):

price = 0

for char in burger:

if char == 'B':

price +=

+= 5

elif char 'C':

price += 8

elif char

'p':

price += 9

elif char 'V':

price += 6

elif char '0':

price += 5

elif char 'M':

price += 7

return price

==

===

Feature 1 - Add Ons [15 Marks

With any burger order, the customer has the option to add one portion of French Fries and/or a drink. The following

table shows the pricing information for French Fries and Drinks for different portion sizes.

Item

Small's

Medium 'M'

Large 'l'

French Fries F

$4

$+$1

$+$2

Drinks 'D

$3

$+$1

S+$2

Consumers are NOT allowed to buy drinks for French Fries without any burger purchase and a maximum of one portion

Similar questions