Question: I need to update this program per these instructions: Original program: // This program produces a sales report for DLC, Inc. #include #include using namespace

I need to update this program per these instructions:

Original program:

// This program produces a sales report for DLC, Inc. #include #include using namespace std; // Function prototypes void calcSales(const int[], const double[], double[], int); void showOrder(const double[], const int[], int); void dualSort(int[], double[], int); void showTotals(const double[], const int[], int); void swap(double&, double&); void swap(int&, int&); int main() { // NUM_PRODS is the number of products produced. const int NUM_PRODS = 9; // Array with product ID numbers int id[NUM_PRODS] = { 914, 915, 916, 917, 918, 919, 920, 921, 922 }; // Array with number of units sold for each product int units[NUM_PRODS] = { 842, 416, 127, 514, 437, 269, 97, 492, 212 }; // Array with product prices double prices[NUM_PRODS] = { 12.95, 14.95, 18.95, 16.95, 21.95, 31.95, 14.95, 14.95, 16.95 }; // Array to hold the computed sales amounts double sales[NUM_PRODS]; // Calculate each product's sales. calcSales(units, prices, sales, NUM_PRODS); // Sort the elements in the sales array in descending // order and shuffle the ID numbers in the id array to // keep them in parallel. dualSort(id, sales, NUM_PRODS); // Set the numeric output formatting. cout maxValue) { maxValue = sales[index]; tempid = id[index]; maxIndex = index; } } swap(sales[maxIndex], sales[start]); swap(id[maxIndex], id[start]); } } //****************************************************** // The swap function swaps doubles a and b in memory. * //****************************************************** void swap(double &a, double &b) { double temp = a; a = b; b = temp; } //****************************************************** // The swap function swaps ints a and b in memory. * //****************************************************** void swap(int &a, int &b) { int temp = a; a = b; b = temp; } //***************************************************************** // Definition of showOrder function. Accepts sales and id arrays * // as arguments. The size of these arrays is passed into num. * // The function first displays a heading, then the sorted list * // of product numbers and sales. * //*****************************************************************

void showOrder(const double sales[], const int id[], int num) { cout

Update program per these instructions:

I need to update this program per these instructions: Original program: //

Create a C++ compiled program following Case Study 8.4 Create your own description removing the current description to describe what each function does, how it works etc. Reference how the book will reference a line number and then explain what a statement or line of code does or how it works. You may use pseudocode. Following conventions used in CIS201 for pseudocode will be accepted. Modify the program to add a menu with a loop which continues to display the menu until the user selects quit Menu items 1. Calculate Sales 2. Sort 3. show order 4. show totals 5. quit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!