Adfaith Consulting是上海的一个小咨询公司,创建于1992年,目前已经有600名以上的全职员工。请创建一个小mis(Management Information System)系统,主要完成对该公司员工信息的管理。在该系统中,员工信息存储在一个名为records的文本文件(或xml文件或其它类型存储)中。
111:02-98781999:Williams:Nick:T:35:Computer Officer:14-10-2000
112:02-99893878:Brown:Sarah:B:12:Electrician:09-02-1992
131:02-95673456:Couch:David:A:26:Consultant:23-04-1994
236:02-95437869:Anderson:Sarah:K:19:CEO:21-09-1988
553:03-99999999:Coles:David:M:12:Manager:12-12-1999
869:02-95671660:Jones:Sarah:B:45:Sales Manager:14-12-1995
148:02-93272658:Smith:John:C:43:Technical Manager:21-10-1988
372:02-12345678:Miller:Sam:B:22:Engineer:12-03-1998
059:02-95673455:Chen:Xiao:Y:26:Consultant:01-05-2003
812:02-98781987:Xue:Fei:L:35:Computer Officer:10-08-1998
619:02-95436669:Wang:Mengjie:X:26:Consultant:12-02-2001
员工信息必须满足以下规范
· employee payroll number:3位数字
· telephone number:XX-XXXXXXXX (X都为数字,详细要求见下文P8)
· name, (last name, first name, initial) (必须都为英文)
· department number, (都为数字)
· job title (必须都为英文)
· date of hiring. XX-XX-XXXX(X都为数字)
Menu.java 是程序的主菜单页面,它实现以下七个功能
1. Displaying all current employee records on the screen.
2. Displaying all current employee records (formatted and sorted) on the screen. (工号)
3. Displaying only names and phone numbers on the screen.
4. Displaying only names and phone numbers (formatted and sorted) on the screen. (名字)
5. Searching for and displaying specific employee record(s).
6. Add new records to the records file.
7. Delete records from the records file.
1 2 3 4主要实现的是显示功能,5实现的是查找功能,6实现的增加功能,7实现的是删除功能。
以下详细描述项目的需求
Adfaith Consulting – Employee Information – Main Menu
=====================================================
1 – Print All Current Records
2 – Print All Current Records (formatted)
3 – Print Names and Phone Numbers
4 – Print Names and Phone Numbers (formatted)
5 – Search for specific Record(s)
6 – Add New Records
7 – Delete Records
Q – Quit
Your Selection: | (waiting for user input)
· 如果上述内容不存在,或者records不存在,, 程序应该提示并终止运行。
比如, 如果records 不存在,应该显示
“Required file – records, does not exist.”, 然后退出程序。
· 在menu菜单上,如果用户的选择输入的不是1, 2, 3, 4, 5, 6, 7或 Q, 程序应该显示"Invalid code! Press Enter to continue…" (这时候,程序的光标应该停在这个消息的后面,而不能停在下一行的开头). 当 用户重新敲回车后,最初的主菜单重新显示以便用户重新做选择。用户可以通过输入Q 或q退出程序.
· 在menu菜单上,,如果用户的选择输入仅仅敲回车,应该提示"No selection entered. Press Enter to continue…"(这时候,程序的光标应该停在这个消息的后面,而不能停在下一行的开头). 当 用户重新敲回车后,最初的主菜单重新显示以便用户重新做选择。
When the User Selects Option 1 – Print All Current Records
Here is a sample output from menu when the user selects option 1 from the main menu:
(The main menu here)
Your Selection: 1 (user input)
111:02-98781999:Williams:Nick:T:35:Computer Officer:14-10-2000
112:02-99893878:Brown:Sarah:B:12:Electrician:09-02-1992
131:02-95673456:Couch:David:A:26:Consultant:23-04-1994
236:02-95437869:Anderson:Sarah:K:19:CEO:21-09-1988
553:03-99999999:Coles:David:M:12:Manager:12-12-1999
869:02-95671660:Jones:Sarah:B:45:Sales Manager:14-12-1995
148:02-93272658:Smith:John:C:43:Technical Manager:21-10-1988
372:02-12345678:Miller:Sam:B:22:Engineer:12-03-1998
059:02-95673455:Chen:Xiao:Y:26:Consultant:01-05-2003
812:02-98781987:Xue:Fei:L:35:Computer Officer:10-08-1998
619:02-95436669:Wang:Mengjie:X:26:Consultant:12-02-2001
Press Enter to continue… (Waiting here for the user to press Enter. After the user presses Enter, the main menu is displayed again)
(Note the difference between the above output and the content of the records file: all the colons (:) have been replaced by spaces))
When the User Selects Option 2 – Print All Current Records (formatted)
Here is a sample output when the user selects option 2 from the main menu:
(The main menu here)
Your Selection: 2 (user input)
Anderson Sarah K 236 02-95437869 19 CEO 21-09-1988
Brown Sarah B 112 02-99893878 12 Electrician 09-02-1992
Chen Xiao Y 059 02-95673455 26 Consultant 01-05-2003
Coles David M 553 03-99999999 12 Manager 12-12-1999
Couch David A 131 02-95673456 26 Consultant 23-04-1994
Jones Sarah B 869 02-95671660 45 Sales Manager 14-12-1995
Miller Sam B 372 02-12345678 22 Engineer 12-03-1998
Smith John C 148 02-93272658 43 Technical Manager 21-10-1988
Wang Mengjie X 619 02-95436669 26 Consultant 12-02-2001
Williams Nick T 111 02-98781999 35 Computer Officer 14-10-2000
Xue Fei L 812 02-98781987 35 Computer Officer 10-08-1998
Press Enter to continue… (Waiting here for the user to press Enter. After the user presses Enter, the main menu is displayed again)
(Note that the above output has been formatted and sorted by family name. Each column must be left justified.)
When the User Selects Option 3 – Print Names and Phone Numbers
Here is a sample output when the user selects option 3 from the main menu:
(The main menu here)
Your Selection: 3 (user input)
Williams,Nick,02-98781999
Brown,Sarah,02-99893878
Couch,David,02-95673456
Anderson,Sarah,02-95437869
Coles,David,03-99999999
Jones,Sarah,02-95671660
Smith,John,02-93272658
Miller,Sam,02-12345678
Chen,Xiao,02-95673455
Xue,Fei,02-98781987
Wang,Mengjie,02-95436669
Press Enter to continue… (Waiting here for the user to press Enter. After the user presses Enter, the main menu is displayed again)
(Note the difference between the above output and the content of the records file. The colons have been replaced by comma. For each entry, only the name and the phone number is displayed)
When the User Selects Option 4 – Print Names and Phone Numbers (formatted)
Here is a sample when the user selects 4 on the main menu,
(The main menu here)
Your Selection: 4 (user input)
Anderson Sarah 02-95437869
Brown Sarah 02-99893878
Chen Xiao 02-95673455
Coles David 03-99999999
Couch David 02-95673456
Jones Sarah 02-95671660
Miller Sam 02-12345678
Smith John 02-93272658
Wang Mengjie 02-95436669
Williams Nick 02-98781999
Xue Fei 02-98781987
Press Enter to continue… (Waiting here for the user to press Enter. After the user presses Enter, the main menu is displayed again)
(Note that the above output has been formatted and sorted by family name. Each column must be left justified.)
When the User Selects Option 5 – Search for specific Record(s)
Here is a sample when the user selects 5 on the main menu,
(The main menu here)
Your Selection: 5 (user input)
Enter keyword: Jones (user input)
869:02-95671660:Jones:Sarah:B:45:sales manager:14-12-1995
Press Enter to continue… (Waiting here for the user to press Enter. After the user presses Enter, the main menu is displayed again.)
如果用户输入的关键字找不到匹配的员工记录,则生成下面页面
(The main menu here)
Your Selection: 5 (user input)
Enter keyword: Monks (user input)
Keyword – Monks – not found
Press Enter to continue… (Waiting here for the user to press Enter. After the user presses Enter, the main menu is displayed again.)
如果用户没有输入任何关键字而直接按回车,则生成下面页面
(The main menu here)
Your Selection, 5 (user input)
Enter keyword: (user simply presses the Enter key without typing in anything)
No keyword entered – try again…
Enter keyword: (still wanting for the user to type in something)
· 用户输入的关键字应该是大小写不敏感的, (比如 JONES 和 jones产生一样的输出).
(The main menu here)
Your Selection, 6 (user input)
Adfaith Consulting – Employee Records:
======================================
Employee Record Additions:
Enter the following details of the new employee:
Employee 3 digit payroll number
Phone Number