I need solution for this :
Write a program for a grocery that reads products data and determine and display the product that has the highest price and the average price. A product has three pieces of data: id (int), name (String) and price (double).
Your program should continue reading new products until user enters -1 as id of a product.
Example:
Enter product id: 1001
Enter product name: Pepsi
Enter product price: 1
Enter product id: 1021
Enter product name: Kit Kat
Enter product price: 2
Enter product id: 1011
Enter product name: Chips
Enter product price: 0.5
Enter product id: -1
-----------------------------
The most expensive product is:
Id: 1021 Name: Kit Kat
Price: 2 S.R.
Average price = 1.167
Please help me