Experiment 3. After reading Using Data Files section. struct persalary int month; /* number 1 corresponds to January, */ long salary; /* 2 corresponds to February, and so on "/ }; struct employee { int empnr; char name[12]; struct persalary salaries[3]; /* three months salaries */ long total; float average; }; /* Employee number */ /" Employee name "/ /* Sum of 3 months salaries */ /" Average of 3 months salaries"/ A) Using the above structure define an array of structure employee for 4 person that will be initialized using a data file(named emp.txt) which has the following data in it. Using Notepad create the following file 121 Ahmet 2 300000 4 400000 12 750000 3 250000 6 800000 7 475000 456 Mehmet 4 750000 5 880000 10 660000 9 775000 234 Ayse 875 Sevgi 2 950000 4 660000 B) Write a function that displays the initialized values as shown below. Note that the integer values corresponding to months are converted to the proper month names. This can be achieved by declaring an array of the month names. Employee Nr 121 Month February April December 750000 Name Ahmet Salary 300000 400000 234 Ayse March 250000 June July April May October February April 800000 475000 456 Mehmet 750000 880000 660000 875 Sevgi 950000 660000

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

c program please use dev c++

Experiment 3. After reading Using Data Files section.
struct persalary
{
int month; /* number 1 corresponds to January, */
long salary; /* 2 corresponds to February, and so on */
};
struct employee
{
int empnr;
char name[12];
struct persalary salaries[3]; /* three months salaries */
long total;
float average;
};
* Employee number */
/* Employee name */
/* Sum of 3 months salaries */
/* Average of 3 months salaries"/
A) Using the above structure define an array of structure employee for 4
person that will be initialized using a data file(named emp.txt) which has the
following data in it. Using Notepad create the following file
121 Ahmet 2 300000 4 400000 12 750000
3 250000 6 800000
456 Mehmet 4 750000 5 880000 10 660000
2 950000 4 660000
234 Ayse
7 475000
875 Sevgi
9 775000
B) Write a function that displays the initialized values as shown below.
Note that the integer values corresponding to months are converted to the proper
month names. This can be achieved by declaring an array of the month names.
Employee Nr
Month
February
April
December 750000
Name
Ahmet
Salary
300000
121
400000
234
Ayse
March
250000
June
July
April
May
October
February
April
800000
475000
456
Mehmet
750000
880000
660000
875
Sevgi
950000
660000
Transcribed Image Text:Experiment 3. After reading Using Data Files section. struct persalary { int month; /* number 1 corresponds to January, */ long salary; /* 2 corresponds to February, and so on */ }; struct employee { int empnr; char name[12]; struct persalary salaries[3]; /* three months salaries */ long total; float average; }; * Employee number */ /* Employee name */ /* Sum of 3 months salaries */ /* Average of 3 months salaries"/ A) Using the above structure define an array of structure employee for 4 person that will be initialized using a data file(named emp.txt) which has the following data in it. Using Notepad create the following file 121 Ahmet 2 300000 4 400000 12 750000 3 250000 6 800000 456 Mehmet 4 750000 5 880000 10 660000 2 950000 4 660000 234 Ayse 7 475000 875 Sevgi 9 775000 B) Write a function that displays the initialized values as shown below. Note that the integer values corresponding to months are converted to the proper month names. This can be achieved by declaring an array of the month names. Employee Nr Month February April December 750000 Name Ahmet Salary 300000 121 400000 234 Ayse March 250000 June July April May October February April 800000 475000 456 Mehmet 750000 880000 660000 875 Sevgi 950000 660000
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY