hi I have a problem finding the lowest and highest selling product in this question. Can you please help me ? this is what I have . It also wants me to display the name of the salsa not how many jars were sold how do I include that in the code. This is the question: Write a program that lets a maker of chips and salsa keep track of their sales for 5 different types of salsa: mild,medium,sweet,hot and zesty. It should use two parallel 5-element arrays: an array of strings that holds the 5 salsa names and an array of integers that holds the number of jars sold during the past month for each salsa type. The salsa names should be stored using an initialization list at the time the name array is created. The program should prompt the user to enter the number of jars sold for each type. Once this sales data has been entered, the program should produce a report that displays sales for each salsa type, total sales, and the names of the highest selling and lowest selling products.
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
const int typesOfSalsa = 5;
const int stringSize = 7;
char salsa [typesOfSalsa][stringSize] = {"mild","medium","sweet","hot","zesty"};
int numOfJarsSold [typesOfSalsa];
int totalJarsOfSalsa = 0;
int highest;
int lowest;
for (int count = 0; count < typesOfSalsa; count++)
{
cout<< "Enter the number of " <<salsa[count]<<" salsa jars sold in the past month: ";
cin>> numOfJarsSold[count];
while (numOfJarsSold[count]<0)
{
cout<< "Please enter a positive number: ";
cin>> numOfJarsSold[count];
}
totalJarsOfSalsa += numOfJarsSold[count];
}
for (int count = 0; count < typesOfSalsa; count++)
{
cout<< "Number of " <<salsa[count]<< " salsa jars sold in the past month: "<<numOfJarsSold[count]<<endl;
}
cout<<"Total number of jars sold in the past month: "<<totalJarsOfSalsa<<endl;
highest = numOfJarsSold[0];
for (int count =1; count < typesOfSalsa;count++)
{
if (numOfJarsSold[count]> highest)
{
highest = numOfJarsSold[count];
}
return highest;
}
cout<<" The highest selling product is: "<<highest<<endl;
lowest = numOfJarsSold[0];
for (int count =1; count < typesOfSalsa;count++)
{
if (numOfJarsSold[count] <lowest)
{
lowest = numOfJarsSold[count];
cout<<" The lowest selling product is: "<<lowest<<endl;
}
}
return 0;
}