Question
C++ Problem a. Create a text file of 15+ products including product Names, unit prices, quantities sold, and sales of each product in your computer
C++ Problem
a. Create a text file of 15+ products including product Names, unit prices, quantities sold, and sales of each product in your computer file. Then input the file into an array of structure ADT to your program.
b. You need to print out the unsorted file.
c. Sort the above data by sorting on the product Names. You may use either bubble sort or selection sort in ascending or descending order on product Names. The arguments of call function must include arrays of structure.
d. You may use C-String function Strcmp (,) to compare two product Names and use Strcpy (,) together to do swapping for sorting.
e. In the program algorithm, you must use -> structure pointer operator.
f. Print out the sorted array: product Names, unit prices, quantities sold, and the sales of each product including the total units sold and the total sales at the bottom of the sorted data..
g. The file path in the desktop can be located by file property: C:\\Users\\yourUsersName\\Desktop\\filename.txt
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