Giải Bài Candidate Management System – Java OOP Cho Anh Em LAB211 (FPT) Đang Đau Đầu

bb7b3c6555086f259368.jpg


Giới thiệu bài lab xịn sò này nè!

Yo yo yo! Nếu bạn đang quay cuồng với môn LAB211 – OOP with Java ở FPT, hoặc đơn giản là muốn flex skill Java hướng đối tượng cho xịn xò, thì bài "Candidate Management System" này chính là "món chính" không thể bỏ qua trong combo luyện code đấy!

Bài này vừa giúp ôn lại kiến thức về kế thừa (inheritance), quản lý list bằng ArrayList, vừa train thêm kỹ năng xử lý input và build chương trình Java Console chuẩn chỉnh. Bên dưới mình có share source code của bài này luôn nha, nhưng nhớ là chỉ tham khảo thôi nhé vì giảng viên có thể đổi yêu cầu bất cứ lúc nào đó!

Mục tiêu chính của bài lab (để không lạc trôi giữa mênh mông code)

• Xây dựng một chương trình Java console để quản lý thông tin ứng viên cho phòng nhân sự (HR) – nghe pro chưa!
• Lập trình hướng đối tượng (OOP) – 4 tính chất phải nằm lòng
• Kế thừa class (Candidate là class cha, 3 class con kế thừa ngoan ngoãn)
• Kiểm tra đầu vào (Validation): năm sinh, số điện thoại, email,... – phải cẩn thận kẻo bug tràn lan
• Quản lý danh sách bằng ArrayList – data structure cơ bản mà quan trọng
• Tìm kiếm ứng viên theo tên và loại – search cho smooth

Yêu cầu kỹ thuật (đọc kỹ kẻo làm sai) ️

Ngôn ngữ: Java (obviously!)
Kiểu ứng dụng: Console Application
Không dùng thư viện ngoài – chỉ sử dụng core Java thuần túy thôi nha
• Áp dụng đầy đủ 4 tính chất OOP (đặc biệt là inheritance, override) – phải thuộc nằm lòng

Bối cảnh bài toán (để hiểu mình đang làm gì)

Công ty cần một hệ thống đơn giản để quản lý các ứng viên phục vụ tuyển dụng. Các ứng viên được chia thành 3 nhóm:

Experience – người đã có kinh nghiệm đi làm (senior vibe)
Fresher – người vừa tốt nghiệp (newbie năng động)
Intern – sinh viên thực tập (đang học hỏi)

Tất cả ứng viên đều có một số thông tin chung (họ tên, năm sinh, địa chỉ, email, v.v.) và mỗi nhóm sẽ có các thuộc tính riêng biệt. Hệ thống sẽ cho phép người dùng:

• Nhập thông tin ứng viên
• Kiểm tra tính hợp lệ của dữ liệu
• Tìm kiếm và hiển thị thông tin

Vì sao bài này quan trọng? (motivation để làm cho hết)

✨ Đây là bài lab cốt lõi của LAB211, được dùng để kiểm tra mức độ hiểu và vận dụng OOP thực tế.

✨ Nếu bạn nắm chắc bài này, bạn sẽ thấy việc làm các bài thực hành sau dễ hơn rất nhiều – trust me!

✨ Khi đi phỏng vấn fresher Java, những bài như thế này cực kỳ hữu ích để kể lại kinh nghiệm học tập và thực hành. Flex luôn đi!

Đề bài gốc – Candidate Management System (LAB211)

Title
Create a Java console program to manage Candidates of company.

Background Context
Candidate management system project in Java is basically developed to manage the candidates of HR (Human Resource) department. In every company, candidate management is very important and it is not easy to handle it manually. So, a candidate management system project is made to be computerized. By computerizing the system, it becomes possible to overcome manual problems and increase efficiency.

Program Specifications
Candidate management system includes some functions are work for creating, updating, deleting as well as searching. Create three classes with three kinds of candidate: Experience, Fresher, Intern

All Candidates have common attributes: CandidateId, FirstName, LastName, BirthDate, Address, Phone, Email andCandidatetype. There are three value of candidate type:

• 0: for Experience
• 1: for Fresher candidate
• 2: for Intern candidate

However, each kind of candidate has addition different attributes:

Experience candidate: year of experience (ExpInYear), Professional Skill (ProSkill).
Fresher candidate has addition attributes: graduated time (Graduation_date), Rank of Graduation (Graduation_rank) and university where student graduated (Education)
Intern candidate: Majors, Semester, Universityname

Main Screen
```
CANDIDATE MANAGEMENT SYSTEM
1. Experience
2. Fresher
3. Internship
4. Searching
5. Exit
Please choose:
```

Function details:

Create Candidate and store inArrayList.

Requirements:
• The program have to check valid data for: Date of Birth, Phone, Email, Year of Experience, Rankof Graduation.
• BirthDate : is number with length is 4 character (1900...Current Year)
• Phone: is number with minimum 10 characters
• Email: with format <account name>@<domain>. (eg: [email protected])
• Year of Experience : is number from 0 to 100
• Rank of Graduation: with one of 4 values (Excellence, Good, Fair, Poor)

From "Main Screen", use select one item (1,2,3) to create candidate. After each candidate is created, the system shows message: Do you want to order now (Y/N)?. User chooses Y to continues, if you chooses N, the program returns main screen and display all candidates who are created.

Search function
User select item 4, the program displays all candidates and requires user inputting Candidate name (First Name or Last Name) and type of candidate. The program will search and display result with: Candidate name (FirstName + LastName), BirthDate, Address, Phone, Email andCandidatetype.

For example:
```
List of candidate:
===========EXPERIENCE CANDIDATE============
Aelbrecht Stefan
Aguirre Eva
Ahlgren Maria
Antosova Adeleva
==========FRESHER CANDIDATE==============
Barbosa De Souza
Cabrera Cornide
Calderon Cuevas
Casulari Motta
===========INTERN CANDIDATE==============
Maria Madeleine
Csokan Babett
Joana Filipa
Patricia Carine

Input Candidate name (First name or Last name): eva
Input type of candidate: 0

The candidates found:
+---+----------------+---------+-------------+----------+-----------------+----+
|No.|Fullname |Birthdate|Address |Phone |Email |Type|
+---+----------------+---------+-------------+----------+-----------------+----+
| 1 |Aguirre Eva | 1990 |Sao paulo |0940394275|[email protected] | 0 |
| 2 |Antosova Adeleva| 1989 |Rio de janero|0984933668|[email protected] | 0 |
```

Technical Requirements
• Use Object-Oriented programming style: inheritance
• Use only core Java functions and classes (no external libraries)

Guidelines

| Slot | Task | Description |
|------|------|-------------|
| 1 | Code Design | Should create Candidate as a SuperClass. Experience, Fresher and Internship Candidate as SubClasses that extend Candidate |
| 2 | Create Fresher Candidate | Should use ArrayList to store Fresher Candidate |
| 3 | Create Intern Candidate | Should use ArrayList to store Intern Candidate |

Source Code – Full Project (Java)

Candidate.java
CandidateManagement.java
Experience.java
Fresher.java
Intern.java
ValidationHelper.java
SE1905L01.java

Open Source! Hãy click vào từng folder để xem được code nhé anh em.

Lời kết (wrap up thôi nào!)

Hy vọng bài chia sẻ này sẽ giúp anh em hiểu rõ hơn cách xây dựng một chương trình Java console theo hướng đối tượng (OOP) – từ việc thiết kế class cha/con, quản lý danh sách bằng ArrayList, đến cách xử lý nhập liệu và tìm kiếm một cách bài bản.

Dù chỉ là một bài lab trong môn học LAB211, nhưng "Candidate Management System" lại là nền tảng cực kỳ quan trọng để rèn luyện tư duy lập trình rõ ràng, sạch sẽ và có cấu trúc. Nếu bạn đang học Java tại FPT hoặc tự luyện Java theo lộ trình backend, thì đừng ngại đọc kỹ, code lại và tùy biến thêm các tính năng để luyện tay nghề nha!

Chúc anh em code vui, không bug và sớm master Java OOP! Hẹn gặp lại ở những bài chia sẻ kế tiếp nha!

Nguồn: tinhte.vn
 
Back
Top