Write a program for recording the sales of a restaurant. You would need to display a menu along with prices. Before choosing an item from the menu, the program will ask for the user's name. Afterwards, the user will choose their desired items along with the quantity. You need to record each item in the database shown below:
Name | Item | Quantity | Cost
---- | ---- | -------- | ----
Ali | Fish & Chips | 2 | 100
Ali | Burger Chips | 1 | 150
Rayyan | Pizza | 1 | 250
Rayyan | Juice | 1 | 80
Your program should be able to handle orders from multiple customers, and each user can order as many items as possible. There can also be multiple people with the same username. After taking orders from all the customers, the program will display an analytics menu. The analytics page should have the following options:
1. Display the entire records (It would display all the data as shown above)
2. Average sales of an item (It would calculate the average sales (cost) of any given item)
3. Total sale for a username (Calculate the total sale for a specific username)
4. Count of an item for a username
5. Median quantity for a specific item
You would need to use arrays and functions in this program and handle input validation as well.