(Use C programming language and struct) Lili has a company, so it has a lot of employees. However, many of Lili employees have changed, resigned, and retired, causing the database that Lili has not synchronized properly. For that reason, Lili asks for your help to help her make a list of Lili employees. Each employee has 3 attributes: • Name (max 20 character) • Gender (Laki-laki / Perempuan) • Division (Management / Accounting / HRD) There are several things you can do on the Lili database : 1. Add Employee In the add employee feature, the new employee will be after the old employee (if all positions are full). Because Lili does not like to have employees who have the same name, if there are employees who have the same name, the employee will not be accepted to work at Lili’s company. New employees will always fill the leftmost places in the database to get a large salary. 2. Change Position The employee’s position determines the employee’s salary, if the employee is in the first position, then the employee’s salary is the highest among all other employees. (The position to be exchanged cannot be empty) 3. Resign To resign, the employee will be deleted from the database, and the position of this employee will be left blank (Can be used again). 4. Retire When an employee retires, the employee’s place and position will be saved and may not be used by other employees, because it is considered that the employee has contributed to Lili’s company. At the end of the year, Lili wants to know the name of every employee who is still active in her company. Help Lili manage the database. Format Input The first line consists of N, the number of processes to be performed. The next N lines represent the process to be carried out. 1. For the 1st process, the input consists of 4 lines (with 4 integers) - the process number, name, gender, and division. 2. For the 2nd process, the input consists of 3 integers - the process number, Employee 1 index, Employee 2 index. 3. For the 3rd process, the input consists of 2 integers - the process number and the index of the employee who will resign. 4. For the 4th process, the input consists of 2 integers - the process number and the index of the employee who will retire. Format Output The output consists of X lines, where X is the number of employees that still work at Lili’s company. Constraints • 1 ≤ N ≤ 100 • 1 ≤ |N ame|, |Gender|, |Division| ≤ 20 Sample Input (standard input) 7 1 Jojo Laki - laki HRD 1 Lili Perempuan Management 1 Bibi Perempuan Accounting 2 1 2 3 2 4 1 1 Joli Laki - laki HRD Sample Output (standard output) Joli Bibi Note The input is ensured to be valid with constraint so there is no need to validate it again. If there are queries that don’t match with the condition, the queries can be ignored.

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 3RP
icon
Related questions
Question

                                                                      Lili Company 1

(Use C programming language and struct)
Lili has a company, so it has a lot of employees.
However, many of Lili employees have changed, resigned, and retired, causing the database
that Lili has not synchronized properly. For that reason, Lili asks for your help to help
her make a list of Lili employees.
Each employee has 3 attributes:
• Name (max 20 character)
• Gender (Laki-laki / Perempuan)
• Division (Management / Accounting / HRD)
There are several things you can do on the Lili database :
1. Add Employee
In the add employee feature, the new employee will be after the old employee (if
all positions are full). Because Lili does not like to have employees who have the
same name, if there are employees who have the same name, the employee will not
be accepted to work at Lili’s company. New employees will always fill the leftmost
places in the database to get a large salary.
2. Change Position
The employee’s position determines the employee’s salary, if the employee is in the
first position, then the employee’s salary is the highest among all other employees.
(The position to be exchanged cannot be empty)
3. Resign
To resign, the employee will be deleted from the database, and the position of this
employee will be left blank (Can be used again).
4. Retire
When an employee retires, the employee’s place and position will be saved and may
not be used by other employees, because it is considered that the employee has
contributed to Lili’s company.
At the end of the year, Lili wants to know the name of every employee who is still active
in her company. Help Lili manage the database.

Format Input

The first line consists of N, the number of processes to be performed. The next N lines
represent the process to be carried out.
1. For the 1st process, the input consists of 4 lines (with 4 integers) - the process
number, name, gender, and division.
2. For the 2nd process, the input consists of 3 integers - the process number, Employee
1 index, Employee 2 index.
3. For the 3rd process, the input consists of 2 integers - the process number and the
index of the employee who will resign.
4. For the 4th process, the input consists of 2 integers - the process number and the
index of the employee who will retire.

Format Output

The output consists of X lines, where X is the number of employees that still work at
Lili’s company.

Constraints
• 1 ≤ N ≤ 100
• 1 ≤ |N ame|, |Gender|, |Division| ≤ 20

Sample Input (standard input)
7
1
Jojo
Laki - laki
HRD
1
Lili
Perempuan
Management
1
Bibi
Perempuan
Accounting
2 1 2
3 2
4 1
1
Joli
Laki - laki
HRD

Sample Output (standard output)

Joli
Bibi


Note
The input is ensured to be valid with constraint so there is no need to validate it again.
If there are queries that don’t match with the condition, the queries can be ignored.

 

 

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
SQL Transaction Concepts
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning