Home » mcq » Visual basic » What will be contained in Msg if grade entered by user is ‘d’? grade=grade.Text.ToUpper If grade==”A” Msg =”Excellent” ElseIf grade==”B” Msg=”Very Good” ElseIf grade==”C” Msg=”Good” ElseIf grade==”D” Msg=”Fair” Else Msg=”Fail” EndIf
Fair
Fail
Good
Excellent
Answer is Wrong!
Answer is Right!
The correct answer is: C. Good
The code snippet is a simple conditional statement that checks the value of the variable grade and assigns a different message to the variable Msg depending on the value of grade. If grade is equal to A, the message Excellent is assigned to Msg. If grade is equal to B, the message Very Good is assigned to Msg. If grade is equal to C, the message Good is assigned to Msg. If
64 288 64 288 64S117.2 64 74.6 75.5c-23.5 6.3-42 24.9-48.3 48.6-11.4 42.9-11.4 132.3-11.4 132.3s0 89.4 11.4 132.3c6.3 23.7 24.8 41.5 48.3 47.8C117.2 448 288 448 288 448s170.8 0 213.4-11.5c23.5-6.3 42-24.2 48.3-47.8 11.4-42.9 11.4-132.3 11.4-132.3s0-89.4-11.4-132.3zm-317.5 213.5V175.2l142.7 81.2-142.7 81.2z"/>
Subscribe on YouTube
grade is equal to
D, the message
Fair is assigned to
Msg. If
grade is not equal to any of the above values, the message
Fail is assigned to
Msg.
In this case, the user entered the grade d. Since d is equal to D, the message Good is assigned to Msg.
The other options are incorrect because they are not the messages that are assigned to Msg when the user enters the grade d.