My compiler says the Declaration syntax error is at (88,2) which is one of the brackets?
I don't really know what could be wrong. Help please. I'm really new at this.
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
#define STD_HOURS 40.0
#define OT_RATE 1.5
int clock[5] = {98401, 526488, 765349, 34645, 127615}; /*initialized arrays clock and wage */
float wage[5] = {10.60, 9.75, 10.50, 12.25, 8.35};
float gross [5]; /* employees gross income */
float hours[5]; /* number of hours employee worked */
float overtime[5]; /* hours of overtime worked */
int i;
main ()
{
void get_hours (void);
void calculate_gross (void);
void calculate_overtime (void);
void display_output (void);
int loop_check (void);
int answer;
do
{
get_hours ();
calculate_gross ();
calculate_overtime ();
display_output ();
answer = loop_check ();
}
while( answer == 1);
}
/* Has user input hours worked */
void get_hours (void)
{
int i;
printf ("Clock# Wage Hours\n");
for ( i = 0; i < 5; ++i)
{
printf("%6i %5.2f ",clock[i], wage[i]);
scanf("%f", &hours[i]);
system("cls");
}
}
/* Calculates gross pay */
void calculate_gross (void)
{
int i;
for(i = 0; i < 5; ++i)
{
gross[i] = (hours[i] > STD_HOURS) ? wage[i]*STD_HOURS+(hours[i]-STD_HOURS)*OT_RATE*wage[i] : wage[i]*hours[i];
}
{
/* Calculates overtime */
void calculate_overtime (void)
{
int i;
for(i = 0; i < 5; ++i)
{
overtime[i] = (hours[i] > STD_HOURS) ? hours[i] - STD_HOURS : 0;
}
}
/* Displays output */
void display_output (void)
{ <-----RIGHT HERE (88,2)
printf("-------------------------------------------\n");
printf("Clock# Wage Hours OT Gross \n");
printf("-------------------------------------------\n");
for(i = 0; i < 5; ++i)
{
printf("%6i %5.2f 5.1f %4.1f %6.2f\n", clock[i], wage[i], hours[i], overtime[i], gross[i]);
}
}
int loop_check (void)
{
int answer;
printf("\nWould you like you enter different hours? (1=yes/2=no)");
scanf("%i", &answer);
return (answer);
}