using namespace std;
// function prototypes
float menu (float currentSales (int twoDArray[ ][30], float oneDArray[]));
void loadSeats(int twoDArray[][30]);
void loadPrices(float oneDArray[]);
float displaySeatingChart (float [][30], float oneDArray[ ]);
//void savePrices(float [ ]) – Saves the current row prices to the file
//“rowPrices.dat”
//void saveSeats(char [ ][30]) – Save the current seating chart to the file
//“seatingChart.dat
int main ()
// declaring variable
{ int choice;
float currentSales = 0;
const int ARRAYCOLUMN = 30;
const int ARRAYROWS = 15;
float oneDArray[ARRAYROWS];
int twoDArray[ARRAYROWS][ARRAYCOLUMN];
// trying to load
// loading seats
loadSeats(twoDArray);
loadPrices(oneDArray);
// calling menu
choice = menu(currentSales, twoDArray[][30], oneDArray[15]);
return 0;
}
float menu (int choice, int twoDArray[ ][30], float oneDArray[])
{
int choice = 0;
while (choice != 4)
{
cout << "*** Main Menu ***" << endl;
cout << "*** Sales This Session " << "<$" << currentSales << ">" << "***" << endl;
if (!priceFile)
{
cout << "No Price File Found. . . " << endl;
cout << "Setting Default Pricing to <$15 for each row>" << endl;
system ("pause");
system ("cls");
function does not take 3 arguments
1>c:\users\hasu\desktop\study\cis c++\project_002\project_002\project_002.cpp(69): error C2082: redefinition of formal parameter 'choice'
1>c:\users\hasu\desktop\study\cis c++\project_002\project_002\project_002.cpp(76): error C2065: 'currentSales' : undeclared identifier
1>c:\users\hasu\desktop\study\cis c++\project_002\project_002\project_002.cpp(88): error C2664: 'displaySeatingChart' : cannot convert parameter 1 from 'int [][30]' to 'float [][30]'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\hasu\desktop\study\cis c++\project_002\project_002\project_002.cpp(106): warning C4244: 'return' : conversion from 'int' to 'float', possible loss of data
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
But now it's giving me these errors? How can i pass 3 parameters in an argument?
Make the function float, and don't pass three arguments to it. I can't bother read all your code, but you can't enter a float number into an integer.
Also, currentSales seems to be undeclared.
//Documentation
//At the top of your project you should have a doc box like the following.
// File: driver.cpp
// Project: 2
// Class: CIS 2541 - Fall 2011
//// Date: Ocotober 24, 2011
//For every function you should have one like this.
// Function: void balance (float Cbalance, float Sbalance)
// Parameters: Cbalance - current Checking Balance
// Sbalance - current Savings Balance
// Returns: nothing
using namespace std;
// function prototypes
float menu (int choice, int twoDArray[ ][30], float oneDArray[],float currentSales);
void loadSeats(int twoDArray[][30]);
void loadPrices(float oneDArray[]);
float displaySeatingChart (float [][30], float oneDArray[ ]);
//void savePrices(float [ ]) – Saves the current row prices to the file
//“rowPrices.dat”
//void saveSeats(char [ ][30]) – Save the current seating chart to the file
//“seatingChart.dat
int main ()
// declaring variable
{ int choice = 0;
float currentSales = 0;
const int ARRAYCOLUMN = 30;
const int ARRAYROWS = 15;
float oneDArray[ARRAYROWS];
int twoDArray[ARRAYROWS][ARRAYCOLUMN];
// trying to load
// loading seats
loadSeats(twoDArray);
loadPrices(oneDArray);
// calling menu
choice = float (menu(currentSales, twoDArray, oneDArray, currentSales));
return 0;
}
float menu (int choice, float twoDArray[][30], float oneDArray[],float currentSales)
{
while (choice != 4)
{
cout << "*** Main Menu ***" << endl;
cout << "*** Sales This Session " << "<$" << currentSales << ">" << "***" << endl;
if (!priceFile)
{
cout << "No Price File Found. . . " << endl;
cout << "Setting Default Pricing to <$15 for each row>" << endl;
system ("pause");
system ("cls");