IN C++
CIS2485 - Programming Assignment #5-6 Assigned: Meeting 7 Due: Meeting 10 Points: 100 Choose a type of product to sell (food, apparel, electronics, cosmetics, housewares, etc.). Create a program which loads 4 parallel arrays with 20 items each. Use your own data. Do not replicate data which I post, nor use data from another student. Make at least 4 categories, for example, if you were categorizing animals, then you would use M for mammal, R for reptile, F for fish, and B for bird. Store the following 4 parallel arrays in main0. Populate them with data using initializer lists. - string I productName - double I productPrice - int [] productQuantity - char I productCategory Requirements: Store your data in parallel arrays: Create the following functions: 1. void displayReport(string pn[], double pp[], int pq[, char pc[]) which will have a report format with headers, detail line and footers as follows (note that widths are suggested with cout manipulators): Product ( setw(20)) xxxxxxxxxxxxxxxxxxxxxx Average Sales: 9999999.99 Price ( setw(10)) 9999999.99 // NOTE: Qty ( setw(10)) 9999999999 This is generated by findTotalSales() Category(setw(10)) Ext. Price (setw(10)) xxxxxxxxxxx 9999999.99 Total Sales: 9999999.99 // NOTE: This is generated by findAverageSales0 2. double findTotalSales(double pp[, int pq[]) 3. double findAverageSales(double pp[], int pqD) 4. void productDetailLine0, productHeader0, and productFooter0 functions to generate parts of the reports. 5. void changeQuantity 0 - search for a product and change the quantity for that product in the array. This will require that the user enter a value (use Scanner here), then search, and enter another value to replace that with. 6. void changePrice 0 - search for a product and change the price for that product in the array. Similar input to # 7. void categoryReport(char c) - send any category to this function to generate a report 8. void priceReport(double p) - send a max price to this function to generate a report for products below the max 9. void sortByNameReport(string pn[, double pp[, int pq[]) - uses a bubble sort and an index sorting algorithm 10. void sortByPriceReport0 - similar to #9 Use a menu which will allow you to do the following with the data (Have this loop with a sentinel to continue or stop as the last menu item or 0 ): 1. Display Report of data in original order with header and footer 2. Display Report of data in original order based on a category (filter) 3. Change Record (one or more fields of your choice) 4. Sort by Name and show report 5. Sort by Price (or some other field of your choice) and show report Output: Show all reporting function output including displayReport0, priceReport0, categoryReport() and sortByNameReport0, sortByPriceReport0. Provide source code and output samples zipped up and posted to the assignment link.
IN C++
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am