I keep getting a error that says invalid conversion from int to int
here is my code
sales report.h
#ifndef SALESREPORT_H
#define SALESREPORT_H
// No description
class SalesReport
{
public:
// class constructor
SalesReport(int[]);
int Salary(int[]);
void DisplaySalary(int[]);
};
#endif // SALESREPORT_H
sales report.cpp
// Class automatically generated by Dev-C++ New Class wizard
#include <cstdlib>
#include "salesreport.h" // class's header file
#include <iostream>
#include <iomanip>
SalesReport::SalesReport(int sales[])
{
Salary(sales);
DisplaySalary(sales);
}
int SalesReport::Salary(int sales[])
{
int arraysize = sizeof(sales);
int i = 0;
while (i <= arraysize)
{
sales[i] = (sales[i]* .09) + 200;
i++;
}
return sales;
}
// End Salary
void SalesReport::DisplaySalary(int sales[])
{
int arraysize = sizeof(sales);
int i = 0;
int rangeA, rangeB , rangeC, rangeD, rangeE, rangeF, rangeG, rangeH, rangeI;
while (i <= arraysize)
{
if (200 <= sales[i] <= 299)
rangeA += 1;
i++;
else if (300 <= sales[i] <= 399)
rangeB += 1;
i++;
else if (400 <= sales[i] <= 499)
rangeC += 1;
i++;
else if (500 <= sales[i] <= 599)
rangeD += 1;
i++;
else if (600 <= sales[i] <= 699)
rangeE += 1;
i++;
else if (700 <= sales[i] <= 799)
rangeF += 1;
i++;
else if (800 <= sales[i] <= 899)
rangeG += 1;
i++;
else if (900 <= sales[i] <= 999)
rangeH += 1;
i++;
else
rangeI += 1;
i++;
}
// End while statement
cout << " Range Number" << endl;
cout << " $200-299 " << rangeA << endl;
cout << " $300-399 " << rangeB << endl;
cout << " $400-499 " << rangeC << endl;
cout << " $500-599 " << rangeD << endl;
cout << " $600-699 " << rangeE << endl;
cout << " $700-799 " << rangeF << endl;
cout << " $800-899 " << rangeG << endl;
cout << " $900-999 " << rangeH << endl;
cout << " $1000 and over " << rangeI << endl;
}
// End Display Salary
main.cpp
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include "salesreport.h"
using namespace std;
int main()
{
int i = 0;
int sales[i];
do
{
cout << "Enter a sales amount (negative to end): ";
cin >> sales[i];
cout << endl;
i++;
} while( sales[i] >= 0);
SalesReport mySalesReport(sales);
mySalesReport.Salary(sales);
mySalesReport.DisplaySalary(sales);
system("PAUSE");
return(0);
}
along with the invalid conversion errors
it keeps saying endl is an undeclared variable
and is says there is a ; expected before each else in the if else statement
can someone find out the problem