Question
Declare a struct named GeneralStore which contains properties as product id, product name, quantity, price and discount. Create a C++ program to handle the following
Declare a struct named GeneralStore which contains properties as product id, product name, quantity, price and discount. Create a C++ program to handle the following file operations in a file store.txt.
insert() : Insert 10 products record into the file in each line. display(): Read and display only the names starting from letter f otherwise display product is not found. discountProducts(): show products from the file which are on 50% discount. sumOfPrice(): Sum of all prices of all products in that file. Write the definition of a function main that tests each of these functions in the form of menu such as: I: insert() D: display() S: sumOfPrice() P: discountProducts(): Note: Every part should be done in the form of function. Each function must have appropriate parameters/return type to access the required functionality. Dont use Global Variable.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started