Capstone · all seven areas
Barangay clearance request desk
Rehearse a full six-hour sitting: a console program for a barangay hall that files clearance requests, processes them in order, keeps an audit trail and exports a report. Fictional scenario; not an actual LGU process.
- Spec no.
- HO-15
- Level
- Capstone · 6 h
- Time box
- 6 h
- Reference
- Java · C#
- Grading
- Self-assessed · rubric is ours, not DICT's
01 Coverage
| Area | Sub-skills practised | Role |
|---|---|---|
| 01 Data manipulation | String, Validation | Also |
| 02 Object-oriented programming | Abstraction, Encapsulation, Inheritance, Composition | Also |
| 03 File handling | Create, Update, Input/output validation | Also |
| 04 Database manipulation | Create, Read, Update, Delete | Also |
| 05 Data structures and algorithms | Queues, Sorting | Also |
| 06 Control structures | Conditional, Iteration | Also |
| 07 Number system | Hexadecimal | Also |
Sign up to start coding practice
Read the task freely. An account is required before editing and running a solution. Code runs also need an internet connection.
Sign up or sign in02 Requirements
- Abstract Document with an integer id and a control number made of a prefix and the id in 4-digit upper-case hexadecimal (BC-0001, BC-001A).
- ClearanceRequest extends Document and owns an Applicant (name, birthdate) created with it. Applicant validates its own name: letters, spaces, . ' and -.
- Store requests in SQLite table requests(id, name, birthdate, purpose, status) through one repository class with create, read, list, update-status and delete.
- new name|yyyy-mm-dd|purpose files a request (status PENDING), adds it to a FIFO processing queue and prints Filed BC-xxxx for name. Reject bad dates and names.
- next releases the oldest waiting request (status RELEASED), skipping cancelled ones, or prints Queue is empty.
- find BC-xxxx shows one request; cancel BC-xxxx deletes it only while PENDING.
- list prints all requests sorted by applicant name. export writes requests.csv with a header row.
- Append FILED, RELEASED and CANCELLED events to audit.log.
03 Input and output
- One command per line: new, next, find, cancel, list, export
- One result line per command; list prints one line per request
- audit.log and requests.csv as shown
new Juan Dela Cruz|1990-05-14|Employment
new Maria Santos|1985-11-30|Business permit
new X|1990-13-01|Loan
new R2D2|1990-01-01|Loan
next
find BC-0002
find bc-0009
cancel BC-0001
cancel BC-0002
list
export
nextFiled BC-0001 for Juan Dela Cruz
Filed BC-0002 for Maria Santos
Invalid birthdate: 1990-13-01
Invalid name: R2D2
Released BC-0001 to Juan Dela Cruz
BC-0002 Maria Santos | Business permit | PENDING
Not found: bc-0009
Cannot cancel BC-0001 (not found or already released)
Cancelled BC-0002
BC-0001 Juan Dela Cruz | Employment | RELEASED
Exported 1 request(s) to requests.csv
Queue is emptyFILED BC-0001
FILED BC-0002
RELEASED BC-0001
CANCELLED BC-0002control,name,purpose,status
BC-0001,Juan Dela Cruz,Employment,RELEASEDMatch the sample exactly first, then write at least two test inputs of your own.
04 Edge cases to test
- A month of 13
- A name with digits
- Cancelling a released request
- Lower-case control numbers in find
- next when only cancelled requests remain
05 Database
Engine: SQLite (Java: org.xerial sqlite-jdbc; C#: Microsoft.Data.Sqlite). An embedded database needs no server, which suits a timed sitting.
- The reference recreates clearance.db and audit.log on start so the sample is repeatable.
The table definitions are in the requirements above and in the reference solution.
06 Starter outline and hints
0:00–0:30 plan classes, table, commands0:30–2:00 Document, Applicant, ClearanceRequest, repository create/read; new and find2:00–3:30 queue + next; cancel; list sorted3:30–4:30 audit log and CSV export4:30–5:30 validation pass and edge cases5:30–6:00 tidy names, comments, final run
Hint 1
String.format("%04X", id) in Java and $"{id:X4}" in C# give the control number; parse it back with base 16.
Hint 2
Keep the queue as ids, and re-read each request from the database when you serve it, so cancellations are respected.
07 Practice rubric
| Criterion | Sub-skills | Look for | Pts |
|---|---|---|---|
| OOP design | AbstractionEncapsulationInheritanceComposition | Abstract Document, encapsulated Applicant, composition inside the request. | 20 |
| Database CRUD | CreateReadUpdateDelete | All SQL in one repository; parameterised; delete only when pending. | 20 |
| Files | CreateUpdate | Audit appended, CSV created; both closed. | 15 |
| Queue and sorting | QueuesSorting | FIFO processing; sorted list. | 15 |
| Validation | ValidationInput/output validation | Dates, names and purposes checked with clear messages. | 15 |
| Control numbers and menu | HexadecimalConditionalIteration | Hex control numbers both ways; one clean command loop. | 15 |
| Total | 100 | ||
Our own weighting for practice. It is not the DICT scoring scheme.
08 Self-check
Tick only what you have verified by running your own program.
Loading saved checks…
09 Reference solution
A compilable sketch of one structure for the capstone. Both versions compiled and reproduced the sample output on Java 21 and .NET 8 when this site was built. Reference solutions are in Java and C#. The 2023 FAQ copy also lists C, C++ and Visual Basic 6.0 / .NET; the same structure carries over, but you will need your language's own file and database APIs.
Try the whole brief first. The reference is one correct approach, not the only one, and reading it early removes most of the practice value.
10 Exam-day habits
- Work without internet search to simulate exam conditions.
- Type the sample input yourself and compare your output line by line before you look at the reference.