School project please help!

The code is suspiciously similar to the code in Password protected system

Are you guys in the same class?