Am I following this right? and can someone help me with the double array. I don't get them quite yet, i know you have to use a for loop within a for loop but that's about it
Write a program that lets a maker of chips and salsa keep track of their sales for five different types of salsa they produce: mild, medium, sweet, hot, and zesty. It should use two parallel five-element arrays: an array of strings that holds the five 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. Input Validation: Do not accept negative values for number of jars sold.
#include <iostream>
using namespace std;
void findLarge (int salsa[], int limit);
void findLow (int salsa[], int limit);
void totalSale (int total[], int limit);
int main()
{
}
void totalSale (int total[], int limit)
{
int total;
int super,mild,medium,sweet,hot,zesty;
for(total=0; total<5; total++)
super=mild+medium+sweet+hot+zesty;
cout<<"The average is "<<super;
}
void findLarge (int salsa[], int limit)
{
int largest;
largest = salsa[0];
for(int x=0; x<limit; x++)
{
if (salsa[x]>largest)
largest=salsa[x];
}
cout<<"The largest salsa sold is "<<largest<<endl;
}
void findLow (int salsa[], int limit)
{
int lowest;
lowest = salsa[0];
for(int x=0; x<limit; x++)
{
if (salsa[x]>lowest)
lowest=salsa[x];
}
cout<<"The lowest salsa sold is "<<lowest<<endl;
}
I guess you're missing the array in which the names are stored... Let me get this properly, You're to make a table, of 2 rows, and 5 columns.. the first row contains the names of different types of salsa, and the next row contains the amount of salsa sold of that type, am I correct?