Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 8 > lesson 11

completing the purchase of a burger
by

1 Answer

iamabhishek
Here is the correct answer:

function scanAndPay(item, amount)
{
console.log("Welcome to scan and pay service");
console.log(`Payment of ${amount} done for purchasing ${item}.`);
}

function orderFood(item)
{
switch(item)
{
case "Burger":
scanAndPay(item, 50);
break;
case "Cold Drink":
scanAndPay(item, 30);
break;
case "Pizza":
scanAndPay(item, 100);
break;
}
}

orderFood("Pizza");

Login / Signup to Answer the Question.