can anyone tell me why my output gives me - numbers?
#include <iostream>
#include<iomanip>
using namespace std;
void getEmployeeData(int [ ], char [ ], int [ ], int);
void displayEmployeeInfo (int [ ], char [ ], float [ ], int);
float calculateGrossPay (char [ ], int [ ], float [ ],int);
bool isValidStatus(char);
//bool isValidID(int);
int main()
{
int stoodunce[4]; //ep id
char stoodunce1[4];//payroll status
int stoodunce2[4];//input if its s/h/c
float stoodunce3[4];//calculates grosspay
getEmployeeData(stoodunce, stoodunce1 , stoodunce2, 4);
calculateGrossPay(stoodunce1, stoodunce2, stoodunce3, 4);
displayEmployeeInfo(stoodunce, stoodunce1, stoodunce3, 4);
system("pause");
return 0;
}
void getEmployeeData(int id[ ], char ps[ ],int input[ ], int size)
{
bool result;
//bool result2;
for (int x = 0; x < size; x++)
{
//do {
cout << "Enter Employee ID : ";
cin >> id[x];
//result2 = isValidID(id[x]);
//} while (result2 == false);
do {
cout <<"Enter Payroll Status (s/h/c):";
cin >> ps[x];
result = isValidStatus(ps[x]);
} while (result == false);
if (ps[x] == 'S' || ps[x] == 's')
{
cout <<"Enter Monthly Salary :";
cin >> input[x];
}
else if (ps[x] == 'H' || ps[x] == 'h')
{
cout <<"Enter total hours worked this month :";
cin >> input[x];
}
else if (ps[x] == 'C' || ps[x] == 'c')
{
cout <<"Enter total sales this month :";
cin >> input[x];
}
}
}
float calculateGrossPay ( char ps [ ], int input [ ], float [ ], int size)
{
float amount;
for (int x = 0; x < size; x++)
{
if (ps[x] == 'S' || ps[x] == 's')
{
amount = input[x] + 0;
}
else if (ps[x]== 'H' || ps[x] == 'h')
{
amount = input[x] * 18.75;
}
else
{
amount = input[x] + 1000;
}
}
return amount;
}
bool isValidStatus(char ps)
{
if (ps == 'S' || ps == 's' || ps == 'H' || ps == 'h' || ps == 'C' || ps == 'c')
return true;
else
{
cout <<"Re-enter: 's' or 'S' for salaried, 'h' or 'H' for hourly,'c' or 'C' for commissioned :";
return false;
}
}
//bool isValidID(int id)
//{
//if (id <= 2 || id >= 4)
//{
//cout << " Re-enter a 3 digit number:" << endl;
//return false;
//}
//else
//return true;
//}
void displayEmployeeInfo (int val[ ],char val1[ ], float val2 [ ], int size)
{
for (int x = 0; x < size; x++)
cout << "Employee ID:" << val[x] << " " << "Payroll Status" << " " << val1[x] << " " <<"GrossPay" << " " << val2[x] << endl;
}
thanks.