Question 1 Here is my program : include #include #include using namespace std; //Prototypes void loadArray(string[],int[],int); void updateSales(string[],int[],int); int main() { int const SIZE = 10; string plantName[SIZE]; int beginningQty[SIZE]; double plantprice[SIZE] = { 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5 }; int totalSales[SIZE] = { 0 }; loadArray(plantName, beginningQty, SIZE); updateSales(plantName, totalSales, SIZE); return 0; } //Function loadArray void loadArray(string plantName[], int beginningQty[], int SIZE) { for (int x = 0; x < SIZE; x++) { cout << "Enter the plant #" << x + 1 << " name: "; getline(cin, plantName[x]); cout << "Enter the beginning quantity on hand for " << plantName[x] << ": "; cin >> beginningQty[x]; cin.ignore(); while (beginningQty[x] < 0) { cout << "Invalid quantity, must be >0"; cout << "Enter the beginning quantity on hand for " << plantName[x] << ": "; cin >> beginningQty[x]; } } return; } void updateSales(string plantName[],int totalSales[], const int SIZE) { string name; int sold; cout << "Enter the name of the plant to update sales: "; getline(cin, name); for (int i = 0; i < SIZE; i++) { if (plantName[i] == name) { do { cout << "Enter the number of " << name << " sold: "; cin >> sold; if (sold < 0) { cout << "Invalid number, please enter a non-negative number.\n"; } } while (sold < 0); totalSales[i] += sold; cout << "Sales of " << name << " updated to " << totalSales[i] << ".\n"; return; } } cout << "Plant " << name << " not found.\n"; return; } Can you help me to write a function to sort the arrays by the plants sold. This function does not print anything. Remember to indent where appropriate. Full explainthe  this question very fast solution sent me step by step  Don't ignore any part all part work u  Text typing work only not allow paper work

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Question 1

Here is my program :

include<iostream>
#include<string>
#include<cctype>
using namespace std;

//Prototypes
void loadArray(string[],int[],int);
void updateSales(string[],int[],int);
int main()
{
int const SIZE = 10;
string plantName[SIZE];
int beginningQty[SIZE];
double plantprice[SIZE] = { 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5 };
int totalSales[SIZE] = { 0 };

loadArray(plantName, beginningQty, SIZE);
updateSales(plantName, totalSales, SIZE);
return 0;
}

//Function loadArray
void loadArray(string plantName[], int beginningQty[], int SIZE)
{
for (int x = 0; x < SIZE; x++)
{
cout << "Enter the plant #" << x + 1 << " name: ";
getline(cin, plantName[x]);

cout << "Enter the beginning quantity on hand for " << plantName[x] << ": ";
cin >> beginningQty[x];
cin.ignore();
while (beginningQty[x] < 0)
{
cout << "Invalid quantity, must be >0";
cout << "Enter the beginning quantity on hand for " << plantName[x] << ": ";
cin >> beginningQty[x];
}
}
return;
}

void updateSales(string plantName[],int totalSales[], const int SIZE)
{
string name;

int sold;
cout << "Enter the name of the plant to update sales: ";
getline(cin, name);

for (int i = 0; i < SIZE; i++)
{
if (plantName[i] == name) {
do {
cout << "Enter the number of " << name << " sold: ";
cin >> sold;
if (sold < 0) {
cout << "Invalid number, please enter a non-negative number.\n";
}
} while (sold < 0);

totalSales[i] += sold;
cout << "Sales of " << name << " updated to " << totalSales[i] << ".\n";
return;
}
}

cout << "Plant " << name << " not found.\n";
return;
}

Can you help me to write a function to sort the arrays by the plants sold. This function does not print anything.

Remember to indent where appropriate.

Full explainthe  this question very fast solution sent me step by step 
Don't ignore any part all part work u 
Text typing work only not allow paper work

Expert Solution
steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Concept of memory addresses in pointers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education