Titansoft interview question

Modify the code base on the new requirements.