For now I want to know, how do I pass the numbers that I input for salsa sales, along to the Total function?
I am still missing a few things.
1: IsValid function(makes it so negative numbers are not accepted)
2: High/Low function(Records the string names of the Highest and lowest inventory counts)
3: Total function(Adds together and Displays sales for all flavors of Salsa)
#include <iostream>
#include <string>
#include "Salsa.h"
usingnamespace std;
int main()
{
Salsa sales;
cout << "Regale me of the month's sales." << endl;
cout << "Mild has " << sales.MILD()<< " total sales";
cout << "Medium has " << sales.MED()<< " total sales";
cout << "Sweet has " << sales.SWEET()<< " total sales";
cout << "Hot has " << sales.HOT()<< " total sales";
cout << "Zesty has " << sales.ZESTY()<< " total sales";
//cout << "Total salsa sales are $" <<sales.Total();
return 0;
/*--------------------------------------------------------------------------------------------------------------
================================================================================================================
Chips and Salsa Write a program that lets a maker of chips and salsa keep track of their sales for five
different types of salsa they 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 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.
=================================================================================================================
=================================================================================================================
---------------------------------------------------------------------------------------------------------------*/
}
#ifndef SALSA_H
#define SALSA_H
#include <string>
class Salsa
{
public:
Salsa();
Salsa(double Price, double Qty){price = Price; qty = Qty;}
double MILD();
double MED();
double SWEET();
double HOT();
double ZESTY();
std::string High();
std::string Low();
virtual ~Salsa();
protected:
private:
double price, qty;
bool Invalid();
//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.
};
#endif // SALSA_H