Answer to Question #314534 in C++ for User 12345

Question #314534

Write a C++ program that lets a maker of chips and salsa keep track of sales for five different types of salsa: mild, medium, sweet, hot, and zesty.


The program should use two parallel 5-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.



1
Expert's answer
2022-03-20T06:20:48-0400

Here is program:

int main()
{
	string salsa[5];
	int jarsalsa[5];
	for (int i = 0; i < 5; i++)
	{
		cin >> jarsalsa[i];
		cin >> salsa[i];
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog