The principal is able to claim 40% of the school bursary total balance instead of just his 5%.
By adding himself as a teacher (which is not being checked in the source code), after graduation the principal is able to both claim the principal's 5% wage and an additional teacher's 35% wage since he became both a teacher and a principal.
The principal is able to commit fraud by registering himself as a teacher therefore claiming much more money than he deserves which is basically stealing (40% instead of 5%).
You can find below a unit test I have written to confirm my finding, asserting that the principal's wage will be 40% of the total bursary balance after graduation instead of only 5%:
Manual source code review
It is recommended to add a condition that prohibits the principal from adding himself as a teacher in the addTeacher() function:
Principal can add themselves as teacher and share in teacher pay upon graduation
Principal can add themselves as teacher and share in teacher pay upon graduation
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.