Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program to read from a file called input.txt information about 5 workers. Each line of input would contain two values respectively, an

Write a C program to read from a file called input.txt information about 5 workers. Each line of input would contain two values respectively, an employee ID and the employees monthly salary.

Assume that the data from the input file is stored in a format as shown in this example. Note: for testing purposes, the following data may not necessarily be used. It is just to give you an idea of the format of the data:

Sample contents of input.txt:

10 2000

20 6800

30 9700

40 1500

50 8000

Store the employee information into a 2D array. Assume that the data types are as follows: id (integer data type) and income (integer data type).

Read the information and store the 5 employee records into the 2D array.

Use a function that prints the sum of all incomes of workers.

Create another function that prints the number of workers who has an income of greater than $5000 and also the ID and income of each worker who has an income of greater than $5000. Sample output printed to the screen:

Sum of all incomes: $ 24500

3 Workers have an income of greater than $5000:

20 $6800; 30 $9700; 50 $8000

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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago