I am having 4 errors with the main program and i dn't know how to slove it anyone to help me how to solve the errors and how the codes was suppose to be correctly typed:
1.error: 'salaried' was not declared in this scope (line 5)
2.error: expected primary expression before 'int' (line 5)
3.error: expression list treated as compound expression in initializer [-fpermissive](line 5)
4.error: expected ',' or ';' before '{' token (line 6)
here are my codes for the main.cpp
#include <iostream>
#include "salaried.h"
using namespace std;
float computeTotalSalaried(Salaried e[], int sz)
{
float totalwage = 0;
for(int i=0; i<sz; i++)
{
totalwage = totalwage + e[i].getAmountPaid();
}
return totalwage;
}
int main()
{
const int MAXSALARIED = 2;
Salaried s1[MAXSALARIED];
cout<<"Processing details of Salaried Employee"<<endl;
for(int i=0; i<MAXSALARIED; i++)
s1[i].inputDetails();
for(int i=0; i<MAXSALARIED; i++)
s1[i].displayDetails();
cout<<"\nTotal to be paid"<<computeTotalSalaried(s1, MAXSALARIED);
return 0;
}