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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
#include <iostream>
#include <cstdlib>
using namespace std;
int displayMenu (string [], int [], int );
void SalsaType (string [], int, int &);
void NumJars (string [], int);
void SalsaPrice (double [], char [], int);
int totalSale (const int [], int);
int uchoice (const int [], int);
int getMin (const int [], int);
int getMax ( const int [], int);
void displaySalsaTypeSoldMontlhy(string [], string [], double [], int);
void displayTotalSalsaSold( string [], double [], int);
const int SIZE = 5;
int main()
{
const int SIZE = 5;
string types [SIZE] = {"mild", "medium", "sweet", "hot", "zesty"} ;
string Jars [SIZE];
double Price [SIZE] = {2, 2, 3, 4, 4};
int uChoice;
}
int displayMenu (string types[], int Prices[], int Jars[], int arrSize)
{
int uChoice;
cout << "Welcome" << endl;
cout << "Please choose from the following salsa offerings: " << endl;
for (int i=0; i<arrSize; i++)
{
cout << i+1 << types[i] << " " << Prices[i] << endl;
}
for (int i=0; i<arrSize; i++)
{
cout << "how many jars of : " << types[i] << endl;
cin >> Jars[i];
}
cin >> uChoice;
return uChoice;
}
void displaySalsaTypeSoldMontlhy(string types [], string Jars [], double Price [], int arrSize)
{
for (int i=0; i<arrSize; i++)
{
cout << types[i] << " "
<< Jars[i] << " "
<< Price[i] << endl;
}
}
void displayTotalSalsaSold( string Jars [], double Price [], int arrSize);
{
for (int=0; i<arrSize; i++)
{
totalSale = (Jars [i] * Price [i]);
}
}
int getMin (const int arr[], int size)
{
int min = arr[0];
for (int i=0; i<size; i++)
{
if (arr[i] < min)
min= arr[i];
}
return min;
}
int getMax (const int arr[], int size)
{
int max = arr[0];
for (int i=0; i<size; i++)
{
if (arr[i] > max)
max = arr[i];
}
return max;
}
|