How do you use switch case in creating variables

System.switch(staff){
    case == 1:
    "A";
    break;
    case == 2:
    "B";
    break;
    case == 3:
    "C";
    break;
    
    default:
    "No staff code specified";
    break;
    
}

Am trying to use switch case in determining the name of a staff based on code they enter. Is there other way to achieve this even if using nested if-else statements?

What is a “staff code”?

This is the code the interviewer enters

Do you mean like a password?
Or the code of what?

Not really. Am sorry I have not been clear enough. I got a work around through it by using nested ? The code would be :

staff_code_name = staff == 1? “A” :
staff == 2? “B” :
staff == 3? “C” :
“No staff code specified”;

if you have more of those it could be something like Staff.HasValue?((char)(64+staff)):"No staff code specified"

Note also that your code will produce the value “No staff code specified” also when it is specified, but different from 1, 2, 3.

Still I have no idea where this may be useful in a survey.

Thank you for enlightening suggestions. I will put that into account. Thanks once again!