print
select code {
S: Single
D: Divorced
M: Married
W: Widowed
else: Incorrect
};
use syntax appropriate for your programming language.
2.Write only the select case statements for
the following problem statement.
The marital code of a person is stored in
the variable called marCode. Display the
corresponding description on the screen.
Provide for an incorrect marital code
Marital Code
S Single
D Divorced
M Married
W Widowed
I Incorrect
3 answers
if marital s=s then
Select case marCode
case “S”
display “Single”
case “D”
display “Divorced”
case “M”
display “Married”
case “W”
display “Widowed”
case else
display ”Incorrect”
endselect
case “S”
display “Single”
case “D”
display “Divorced”
case “M”
display “Married”
case “W”
display “Widowed”
case else
display ”Incorrect”
endselect