Hi everyone, I have written a program and have encountered a few errors that I can't seem to fix(or don't know how to), any help would be great. Thanks in advance for the help! I'm very new to this so bare with me!:cheesy:

#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
void get_wages(long[], int[], float[], float[], int);
void display_wages(long[], float[], int);
 

int main()
{
    cout << "This program written for cs102 Online.\n";
    const int size = 7;
    long empId[size] = {5658845, 4520125, 7895122, 8777541, 8451277, 1302850, 7580489};
    int hours[size];
    float pay_rate[size], wages[size];
    
    get_wages(empId, hours, pay_rate, wages, size;
    display_wages(empId, wages, size);
    system("PAUSE");
    return 0;
}
void get_wages(long empId[], int hours[], float pay_rate[], float wages[], int size)
{
     cout << "Employee ID number:" << endl;
     for (int count = 0; count < size; count++)
     {
         cout << "Employee ID number: ";
         cout << empId[count] << endl;
         cout << "Total number of hours worked: ";
         cin >> hours[count];
         while (hours[count] < 0)
         {
         
               cout << "The hours worked cannot be negative, please enter a positive number. " << endl;
               cout << "Total number of hours worked: ";
               cin >> hours[count];
               }
         cout << "Employee's pay rate: ";
         cin >> pay_rate[count];
         while (pay_rate[count] < 6.0);
         {
               cout << "The employee's pay rate cannot be less than 6.00, please enter a higher pay rate. " << endl;
               cout << "Employee pay rate: ";
               cin >> pay_rate[count];
               }
         
         wages[count] = pay_rate[count] * hours[count]; // formula for gross wages
                      }
}
void display_wages (long empId[], float wages[], int size)
        cout << "\n\n";
        cout << "|||Employee ID Number|||Gross Wages|||" << endl;
        cout << "--------------------------------------" << endl;
        cout << fixed << showpoint << setprecision(2);
        
        for (int count = 0; count < size; count++)
        {
        
        cout << "   " << empId[count] << "    ";
        cout << "$ " << wages[count] << endl;
        }
}

Good news - there's only 2 syntax errors here!

You're missing a closing ')' here:

int main()
{
    cout << "This program written for cs102 Online.\n";
    const int size = 7;
    long empId[size] = {5658845, 4520125, 7895122, 8777541, 8451277, 1302850, 7580489};
    int hours[size];
    float pay_rate[size], wages[size];
    
    get_wages(empId, hours, pay_rate, wages, size;

And here, you forgot to place an opening brace '{' to start the function:

void display_wages (long empId[], float wages[], int size) // missing {
        cout << "\n\n";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.