pizza
pepperoni pizza
cheese pizza
bacon pizza
const menu = { items: { item1: { name: "Pizza", price: 10, quantity: 5 }, item2: { name: "Burger", price: 8, quantity: 3 }, item3: { name: "Salad", price: 7, quantity: 4 }, }, accessCode: "password", addItem: function(name, price, quantity) { if (price <= 0) { console.log("Invalid price. Please enter a valid price."); } else if (name === "") { console.log("Invalid item name. Please enter a valid item name."); } else { let newItem = { name: name, price: price, quantity: quantity }; this.items[name.toLowerCase()] = newItem; console.log(name + " has been added to the menu."); } }, removeItem: function(name) { if (this.items[name.toLowerCase()]) { delete this.items[name.toLowerCase()]; console.log(name + " has been removed from the menu."); } else { console.log("Item not found on the menu."); } }, checkCode: function(code) { return code === this.accessCode; }, placeOrder: function(code, itemName, quantity) { if (!this.checkCode(code)) { console.log("Invalid access code."); return; } let item = this.items[itemName.toLowerCase()]; if (!item) { console.log("Item not found on the menu."); return; } if (item.quantity < quantity) { console.log("Item quantity not available."); return; } item.quantity -= quantity; console.log("Order placed successfully. Total cost: " + (item.price * quantity)); } };