Question: Write a C program that will calculate the pay for employees. For each employee the program should prompt the user to enter the clock number
Write a C program that will calculate the pay for employees.
For each employee the program should prompt the user to enter the clock number a unique employee IDwage hourly pay rateand number of hours worked in a given week. This input will be used to determine the gross pay for a given week, which is the number of hours worked in a given week multiplied by the employee's hourly wage.
Use the following data as test input for clock number, wage, and hours.
Clock
Wage
Hours
NOTE: The program should only process one employee at a time. You will run this program FIVE times, entering in the Clock, Wage, and Hours worked for a given employee.
Below are some additional items to keep in mind when doing this assignment:
Use the code template provided in contains all the code you need to get started with this assignment. Most of the remaining requirements that follow are already done for you. This week's assignment is more about learning how to document, compile, run, test, and submit a C program.
Assume that clock numbers are at most digits long and pad with leading zeros when printing if less than digits
Understand that you can not type in the leading zeros for your input, for example, typing in results in that number being known to the compiler as an Octal number recall it starts with a zeroand worst, it is invalid because it contains the digits and only are validType in the number and print with leading zeros to get around this issue. See the "Sample Output" section below to better illustrate what I am requesting.
Zero suppression of float fields is important, use the formatting syntax shown in your lecture notes. For example, show just two digits past the decimal point for money fields such hourly wage and gross pay, and only a single digit pass the decimal for the hours field. Without any formatting, the output will show the default of six decimal places such as: or which does not make for readable output.
Do not use any material from any chapters beyond this week's lecture notes. I realize you could use advanced topics like loops, arrays, pointers, linked lists, strings, structures, and functions but part of the challenge is using only what we covered so far. Rest assured that future homework will incorporate all these advanced topics in the weeks that follow.
In particular, do not use any looping. Just process one employee input data set, calculate the gross pay, and print the information out for a single employee per the sample output guidelines.
You may use file pointers if you wish, but it is purely optional. Doing so will allow you to print the output in the advanced manner shown in the last section at the end of this page. See the coding template provided in the lecture note that follows to get started with this option. This is not an option if you use IDEOne as it does not support input and output file processing
To submit the assignment for grading:
If using IDEOne, just submit the generated URL for a single program run. Pick any of your sample runs using one of the provided set of test input data items clockwage and hours
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
