Banco Bradesco Interview Question

basic OOPs and 2 question on string manipulation