Pergunta de entrevista da empresa Experian

Giving the problem with applied pattern solve them using if else statement.