C program that will calculate the gross pay of a set of employees

Write a C program that will calculate the gross pay of a set of employees.

For each employee the program should prompt the user to enter the clock number, wage rate, and number of hours as shown below.

The program determines both the overtime hours (anything over 40 hours) and the gross pay, and outputs the following format. Hours over 40 are paid at time and a half.

Clock# Wage Hours OT Gross
098401 10.60 51.0 11.0 598.90

In the example above, since the employee worked 51 hours, 11 of those hours are overtime and are paid at time and a half. The first 40 hours are paid at the standard
time using the hourly wage rate. If no overtime hours are worked, just indicate 0.0 hours in your output.

Column alignment, leading zeros in Clock#, and zero suppression in float fields are important.

With this and in future assignments, please start using constants. For example, instead of hard coding a value for 40.0, use a constant:

#define STD_HOURS 40.0

Replace 40.0 in your code with the symbolic constant STD_HOURS

There are a few other constants you should define and use for this assignment. Use at least one more constant in your homework.

Use the following data as test input:

Clock# Wage Hours 98401 10.60 51.0 526488 9.75 42.5 765349 10.50 37.0 34645 12.25 45.0 127615 8.35 0.0

Solution Preview:

#define STD_HOURS 40.0
#define OVERTIME_RATE 1.5

int main()
int datacount = 0; /* Number of test data sets */
int clockNo = 0;
float wage = 0.0;
float hours = 0.0;
float gross = 0.0; /* Variables to hold gross salaries */
float OT = 0.0; /* Variables to hold overtime */

int i = 0; /* loop counter */
printf(“Employee pay calculatornn”); /* Program Info */
printf(“How many employees data you wish to enter? “); /* Prompt text */
scanf(“%d”,&datacount); /* Get test data count from the user */

printf(“nEnter Employee’s Clock #: “);
scanf(“%d”, &clockNo);
printf(“Enter hourly wage: “);
scanf(“%f”, &wage);
printf(“Enter no. of hours worked: “);
scanf(“%f”, &hours);

if (hours > STD_HOURS) // Overtime condition
OT = hours – STD_HOURS;
gross = (wage * STD_HOURS) + (OT * OVERTIME_RATE * wage);
OT = 0.00;
gross = wage * hours;



}while(i < datacount);
return (0);


What We Offer:

• On-time delivery guarantee
• PhD-level professionals
• Automatic plagiarism check
• 100% money-back guarantee
• 100% Privacy and Confidentiality
• High Quality custom-written papers

find the cost of your paper

prepare a lead container of mass 1.5 kg and pour 0.65 kg of water into it, both at the room temperature of 20.5°C.

You are at a restaurant eating lunch with a friend. After the meal, your friend realizes they left their wallet at home. Your friend gives you a piece of silver….

Given the above information, how many people did McKinsey and BCG hire in the year 2013?

There are two big consulting firms in Melbourne, McKinsey and Boston Consulting Group (BCG); assume that their clients view them as providing identical consulting services. They hire people on yearly….

write a program that reads a file and displays all of the words in it that are misspelled.

A spell checker can be a helpful tool for people who struggle to spell words correctly. In this exercise, you will write a program that reads a file and displays….