Sollicitatievraag bij Experian

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