Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help with part 2 Description You are making a program for a small company that wants to consolidate and sort some of them

i need help with part 2 image text in transcribed
image text in transcribed
Description You are making a program for a small company that wants to consolidate and sort some of them employee data. This will involve 3 data files of an employee, "hours.txt", "wages.txt", and "adjustments.txt". The first part of the program, will be to open both hours.txt and wages.txt before combining them into a new file, "paymentReport.txt" that puts the hours in the first column, and wages in the next column, effectively combining the two sets of data into one file. This should be done in a manner that is visually tidy and lines up using our text formatting "%n.mlf". Here is a small example of what the file output should be: HOURS :: WAGES XX.X xxxxxx X.X . XX.X XXX.XX XXX.X XXXX.XX XXX.X XXXX.XX X.X XX.XX XX.X XXXXXX This should use a loop similar to the end of file loop seen in Lab 2. Such as below: while (ifeof (hoursFile) 88 Ifeof(wagesFile)) { //Read in data from the two files V/ write the combined data to the file "payment Report.txt" } The next part of this program, should read in the "adjustments.txt" which will contain a series of positive and negative numbers based on bonus and docked pay earned in the past. The client wants these adjustments sorted where if a value that is negative is read in it should be saved to a "dockedPay.txt" file and if a positive number is read in then it should be stored into "bonus Pay.txt" instead. This process will require a command structure, if/else, and the end of file loop used in Lab2. This can use a loop similar to the end of file loop seen in Lab 2 and a simple. Such as below: while (feof(adjustmentsFile)) { W Read in data from the two files // Conditionally write into either bonuspay.txt or dockedPay.txt if else { > } . . . Your program should define the following functions: (7pts) int main() - This should be all that resides in the main.c along with the necessary #includes/#defines and only run the functions process Report() and process Adjustments before calling return. (15pts) void process Report () - This function should perform the necessary operations on the "hours.txt" and "wages.txt" files as described in the description, combining the two into a neatly ordered file named "paymentReport.txt". (15pts) void processAdjustments () - This function should work on splitting the positive and negative values in the "adjustments.txt" file to their own separate files "bonus Pay.txt" and "dockedPay.txt". ( 6pts) Opening and closing all files correctly ( 4pts) The processed data file output is formatted correctly as shown in the description ( 8pts) This program should have 3 files: main.c, fileSort.h, and fileSort.c How this should be done was described and demonstrated in Lecture 8 of Week 4 (2pts) for comment header with: 1. Name, 2. Date, 3. Course, 4. Assignment # and Title, 5. Description ( 3pts) for properly adding a short comment to each function briefly describing it NOTE:: There should be no user interaction with this program. This program should run through it's file processing and then finish without needing user input. Additionally, outside of the three required functions of main(), process Report, and process Adjustments, any additional functions you wish to implement are at your discretion

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What are some of the possible scenes from our future?

Answered: 1 week ago

Question

1. What are your creative strengths?

Answered: 1 week ago