Please use simple C++ commands and libraries. This is a beginning c++ class and
ID: 3546861 • Letter: P
Question
Please use simple C++ commands and libraries. This is a beginning c++ class and I can't be using obscure libraries/algorithms/commands in my code.
Write a program that lets a maker of chips and salsa keep track of their sales for five different types of salsa the 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 inegers 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 slasa type, total sales, and the names of the highest selling and lowest selling products.
Thanks so much!
Explanation / Answer
#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;
}