Question 8:
(2.5 mark, file to be edited: Q8.c)
The program allows the user to enter information for n products (n is an integer entered from the
keyboard).
For each product, the information includes:
•
id (char[])
•
name (char[])
•
price (float)
•
brand (char[])
After entering all products, the user enters an integer option to choose one of the following
operations:
1. Option 1: Display the list of all products.
2. Option 2: Display all products and the total price of all products.
6 of 6
Paper No: 3
3. Option 3: Display the product(s) with the highest price.
If the entered option is invalid, print "Invalid option!".
Hint: Use an array of structures to organize the data in the program.
Below is a sample output of the program: Enter n = 3
Zoom
option = 1
+ 100%
option = 2
Close