chips and salsa

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;
}
can someone point to whether or not I'm on the right track or not please. And how would i start the double array?
what am i doing wrong here?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <iostream>
using namespace std;

void findLarge ();
void findLow ();
void totalSale ();

int main()
{
	const int salsaName=5;
	const int salsaSold=5;
	int count,mix,name;

	cout<<"Please enter how many number of jars of salsa you've sold"<<endl;

	for(count=0;count<salsaName;count++)
	{
			cin>>mix;
	for(count=0;count<salsaSold;count++)
		{
			cin>>name;
		}
	}
	void totalSale();
	void findLarge();
	void findLow();
}

void totalSale ()
{
	int total;
	int super,mild,medium,sweet,hot,zesty;
	super=mild+medium+sweet+hot+zesty;
	cout<<"The average is "<<super;
}
void findLarge ()
{
	int largest,salsa, limit;
	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 lowest,salsa,limit;
	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;
}
can someone help me please?
line 24-26: Omit the result types (void). This way the functions are declared (like line 4-6) and not called
okay thank you, is there anything else that I'm missing
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?
Topic archived. No new replies allowed.