Question: Lab Practice 5 : Arrays Write a program that simulates a menu for a bakery called cakes . It will contain the following options: a
Lab Practice : Arrays
Write a program that simulates a menu for a bakery called cakes It will contain the following options:
a Register ProductUse systempause between menu optio ns
b Delete Product
c Print Product Info
d Update Product
e Sell Product
f Exit. Use systempause at the end of each option.
Option a: Ask for the product: key, name, price, quantity. Save all info into an arrays with elements.
You will register ONE product at a time, then your program will return to the main menu. Reject
duplicate product keys and names. Validate your program so that it cannot register more products. Use maps in place of arrays. Replace arrays with vectors.
Option b: Ask for the product key, then delete all info for that product.
Option c: Ask for the product key, then print product: name, price, quantity, total no of sales.
Option d: Ask for product key, then present the following submenu: Use try catch to reject invalid in puts.
a Update Product Name
b Update Product Price
c Update Product Quantity
d Exit
Option e: Ask for the product key. If any is available, input amount to sell and update the quantity array.
Option f: Exit This program is to save all products into files. Use Track product profits
Validate your program so that it DOES NOT accept negative values for price, quantity, and sales. Your
menus MUST be switch cases, MUST loop with dowhile loops, and MUST handle invalid inputs. Replace cin with scanf and cout with printf Use go to statements
Use try catch statements for error handlin gin p lace of switch cases.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
