I am working on this basic c program for a class I am taking. We are having trouble getting to call the CalculateHourlyWage at the end of the program. We want it to display an employees hourly wage and print it on the screen. I do not have to much experience in C, so any help you guys can provide me with would be great!
Code:
/* This is a C program to printout the hourly wage */
/* given a yearly salary and hours worked per month */
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
float CalculateMonthlySalary (float, float);
float CalculateHourlyWage (float, float);
main()
{
int YearlySalary;
int HoursWorkedPerMonth;
float MonthlySalary;
float HourlyWage;
float x, y, z;
/* Define the Yearly Salary */
YearlySalary=90000;
/* Define the Hours Worked Per Month */
HoursWorkedPerMonth=160;
x=YearlySalary;
y=12;
z=HoursWorkedPerMonth;
/* call function product using arguments */
printf("** Hourly Wage is $%5.0f ** \n", HourlyWage);
}
/* Two functions are defined as follows */
/* (1) Formula of the calculation of the monthly salary */
float CalculateMonthlySalary (float x, float y)
{
float Salary;
Salary = (x/y);
return(Salary);
}
/* (2) Formula of the calculation of the hourly wage */
float CalculateHourlyWage (float MonthlySalary, float z)
{
float Wage;
Wage = (MonthlySalary/z);
return(Wage);
}
/* END of the program */