Exam 70-483 Topic 5 Question 68 Discussion
Actual exam question for Microsoft's 70-483 exam
Question #: 68
Topic #: 5
Question #: 68
Topic #: 5
You have a method that will evaluate a parameter of type Int32 named Status.
You need to ensure that the method meets the following requirements:
* If Status is set to Active, the method must return 1.
* If Status is set to Inactive, the method must return 0.
* If Status is any other value, the method must return -1.
What should you do? (To answer, drag the appropriate statement to the correct location in the answer area.
Each statement may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

You need to ensure that the method meets the following requirements:
* If Status is set to Active, the method must return 1.
* If Status is set to Inactive, the method must return 0.
* If Status is any other value, the method must return -1.
What should you do? (To answer, drag the appropriate statement to the correct location in the answer area.
Each statement may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

Suggested Answer:

Explanation

Example:
int caseSwitch = 1;
switch (caseSwitch)
{
case 1:
Console.WriteLine("Case 1");
break;
case 2:
Console.WriteLine("Case 2");
break;
default:
Console.WriteLine("Default case");
break;
}
Reference: switch (C# Reference)
https://msdn.microsoft.com/en-us/library/06tc147t.aspx
by Kent at Feb 05, 2024, 11:44 AM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).