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

Need Help!! Level 8 Lesson 11

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":

break;
case "Cold Drink":

break;
case "Pizza":

break;
}
}
by

1 Answer

afrideen
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");

Notes:*
In three scanAndPay(item, value) u can replace the values in the instruction as like 50 , 30 , 100
In orderFood("Pizza") it may be work if it shows error change as
 orderFood("Burger") or another one 
change it

Login / Signup to Answer the Question.