"Argument of type 'DrinkInfo*' is incompatiable with paramater of type 'int*'"
Any ideas on what I am doing wrong here?
Thanks!
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
const int DRINKS = 5;
struct DrinkInfo
{
string name;
int numDrinks;
double price;
};
class SodaMachine
{
private:
void inputMoney();
void dailyReport();
public:
void buyDrink(int []);
void displayChoices();
};
int main ()
{
SodaMachine sodas;
int choice = 0;
DrinkInfo soda[DRINKS] = {{"Cola", .75, 20}, {"Root Beer", .75, 20}, {"Orange Soda", .75, 20},
{"Grape Soda", .75, 20}, {"Bottled Water", 1.00, 20}};
do
{
sodas.displayChoices();
cin >> choice;
sodas.buyDrink(soda);
}while (choice != 6);
return 0;
}
/*************SodaMachine::displayChoices************/
//This function displays a menu of drink choices
void SodaMachine::displayChoices()
{
//outputs a menu
cout << "*********************************\n";
cout << "* Drink Name Cost *\n";
cout << "*********************************\n";
cout << " (1) Cola $0.75 \n";
cout << " (2) Root Beer $0.75 \n";
cout << " (3) Orange Soda $0.75 \n";
cout << " (4) Grap Soda $0.75 \n";
cout << " (5) Bottled Water $1.00 \n";
cout << "_________________________________\n";
cout << " \n (6) Quit \n";
cout << endl;
cout << "Please enter a selection: ";
}
/************SodaMachine::buyDrink***************/
//This function handles drink purchases
void SodaMachine::buyDrink(int soda[])
{
char confirm;
int choice;
cout << "You chose " << soda[choice-1] << " would you like to purchase this drink?";
cin >> confirm;
}
/***********SodaMachine::inputMoney**************/
//This function takes the users money for the
//drink purchase
void SodaMachine::inputMoney()
{
}

New Topic/Question
Reply



MultiQuote







|