Warning W8070 ModularPay.c 69: Function should return a value in function Calc_GrossPay
Warning W8070 ModularPay.c 76: Function should return a value in function Calc_NetPay
Warning W8065 ModularPay.c 83: Call to function 'Id' with no prototype in function main
Warning W8065 ModularPay.c 84: Call to function 'Rate' with no prototype in function main
Warning W8065 ModularPay.c 85: Call to function 'Regular' with no prototype in function main
Warning W8065 ModularPay.c 86: Call to function 'Overtime' with no prototype in function main
Warning W8065 ModularPay.c 87: Call to function 'Calc_GrossPay' with no prototype in function main
Warning W8065 ModularPay.c 88: Call to function 'Calc_NetPay' with no prototype in function main
/* Computes Employee monthly gross pay, net pay, and parking */
#include <stdio.h> /* allows printf and scanf functions */
#include <stdlib.h> /* provides function abs */
#include <string.h>
#include <math.h>
#define Parking 10
#define Tax .30
/*Declare variables */
double employee_id;
double HourlyRate;
double RegHours;
double OverTimeHours;
double GrossPay;
double NetPay;
/* Declare functions */
void Id();
void Rate();
void Regular();
void Overtime();
float Calc_GrossPay();
float Calc_NetPay();
void Id()
{
/* Get Employees Id */
printf("Enter your Employee Identification \n");
scanf("%d",&employee_id);
printf(" Your Employee Identification is: %d \n", employee_id);
}
void Rate()
{
/* Get Employees Hourly Rate */
printf("Enter your hourly Rate\n");
scanf("%lf",&HourlyRate);
printf("Your Hourly Rate is: %lf \n", HourlyRate);
}
void Regular()
{
/* Get Employees Regular hours */
printf("How many regular hours do you have\n");
scanf("%d",&RegHours);
printf("Your regular hours are: %d\n", RegHours);
}
void Overtime()
{
/* Get Employees overtime hours */
printf("How many overtime hours do you have for the week\n");
scanf("%d",&OverTimeHours);
printf("Your total overtime hours are: %d \n", OverTimeHours);
}
float Calc_GrossPay()
{
GrossPay = RegHours + HourlyRate + OverTimeHours * (HourlyRate * 1.5) ;
printf("Your Gross Pay is:%f \n", GrossPay);
}
float Calc_NetPay()
{
NetPay = ((GrossPay * Tax)- Parking);
scanf("%f", &NetPay);
printf("Your Total Net Pay is: %f \n", NetPay);
}
int main(void)
{
printf("Welcome to Super Supermarket Employee Payroll System\n");
Id();
Rate();
Regular();
Overtime();
Calc_GrossPay();
Calc_NetPay();
return(0);
}

New Topic/Question
Reply




MultiQuote







|