Q1_20251108152425.webp
S

Q1_20251108152425.webp

  • Media owner Shoko91
  • Ngày thêm

cases.
Each of the next T lines contains one of the following four types of commands:
1. Add id name salary department adds a new employee.
2. Update id name salary department - updates an employee based on the given
ID.
3. Print
displays the list of employees.
Output:
4. Sort
sorts the employee list by name.
5. Clear
remove all employees and print "Cleared employee list."
All results must be written to the output.txt file.
Sample Input 1
input.txt
2
Add 1 Alice 1500.00 HR
Print
output.txt
Added:
1-Alice-1500.00-HR
Employees:
1-Alice-1500.00-HR
Sample Input 2
input.txt
5
Add 1 Alice 1500.00 HR
Update 1 Ali 1300.00 IT
Clear
Add 1 Alice 1500.00 HR
Print
output.txt
Added:
1-Alice-1500.00-HR
Updated:
1-Ali-1300.00-IT
Clear all.
Added:
1-Alice-1500.00-HR
Employees:
1-Alice-1500.00-HR
Zoom
Sample Input 3
input.txt
5
Add 1 Alice 1500.00 HR
Add 2 Bob 2200.00 IT
Add 3 Alex 1800.00 IT
output.txt
Added:
1-Alice-1500.00-HR
Added:
2-Bob-2200.00-IT
+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
Shoko91
Ngày thêm
Lượt xem
1,308
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom