Im fairly new in the programming world, and I picked up a problem recently of which I've been struggling with, a lot! This was the starter code.
My question is:
How do I get JUST the arrays working properly...apparently it should be a two parallel 5-element arrays that prompts the user for the number of jars sold.
I have been doing some research about arrays but nothing I try seems to be working, and it has become reallty confusing for me.
Any help, suggestion, hint or idea really would be very appriciated!
#include<iostream>
#include<string>
#include <iomanip>
usingnamespace std;
int main() {
// Constant for the number of salsa types
// Array of salsa types
string types[NUM_TYPES] = {"mild ",
"medium",
"sweet ",
"hot ",
"zesty "};
// Array of sales of each salsa type
// Total number of jars sold
// Subscript of the salsa that sold the most.
// Subscript of the salsa that sold the least.
// Get the number of jars sold of each type of salsa.
// Get the number of jars sold.
cout << "Jars sold last month of "
<< types[type] << ": ";
cin >> sales[type];
// Validate the input.
cout << "Jars sold must be 0 or more. "
<< "Please re-enter: ";
cin >> sales[type];
// Get total sales and high and low selling products
// Display the sales report header.
cout << endl << endl;
cout << " Salsa Sales Report \n\n";
cout << "Name Jars Sold \n";
cout << "____________________________\n";
// Display the name and jars sold of each type.
cout << types[salsaType]
<< setw(21) << sales[salsaType]
<< endl;
// Display the total sales, highest seller, and lowest seller.
cout << "\nTotal Sales:" << setw(15) << totalJarsSold << endl;
cout << "High Seller: " << types[hiSalesProduct] << endl;
cout << "Low Seller : " << types[loSalesProduct] << endl;
return 0;
}