Cognizant interview question

Coding question on switch case and array