Im trying to write a program from this programming book i just bought and am having some difficulty. Actually im totally lost i need some direction or any help would be usefull.
Here is what the program calls for:
Write a program that lets a maker of chips and salsa keep track of their sales for 5 different types of salsa they produce: 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 the 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.
Heres what i have so far:
Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
string salsa[] = {"mild", "medium", "sweet", "hot", "zesty"};
int jars[5];
int total_sales = 0;
int index, i;
cout << "Enter the number of jars sold for the mild salsa: ";
cin>>jars[0];
cout << "Enter the number of jars sold for the medium salsa: ";
cin>>jars[1];
cout << "Enter the number of jars sold for the sweet salsa: ";
cin>>jars[2];
cout << "Enter the number of jars sold for the hot salsa: ";
cin>>jars[3];
cout << "Enter the number of jars sold for the zesty salsa: ";
cin>>jars[4];
return 0;
} // end main