exam questions

Exam MB-500 All Questions

View all questions & answers for the MB-500 exam

Exam MB-500 topic 7 question 12 discussion

Actual exam question from Microsoft's MB-500
Question #: 12
Topic #: 7
[All MB-500 Questions]

A developer submits code for a quality assurance review. Several lines of code use the var data type.
You need to validate the segments for the correct X++ structure.
Which code statement will pass validation?

  • A. var var1 = systemDataGet(); var1 = var1 ? today():ג€Not todayג€;
  • B. var var1 = (var1 >= false) ? true:10;
  • C. var var1 = true; var1 = true ? 10:false;
  • D. var var1 = true ? 10:ג€10ג€;
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
UR_7
2 months, 3 weeks ago
Selected Answer: C
A and C are both incorrect because of using '=' instead 0f '=='. All answers are wrong to me! I selected c because it doesn't let me submit my comment without selecting one!
upvoted 1 times
...
8933e4c
7 months ago
Selected Answer: C
If I assume D is var var1 = true ? 10:"10" then C remains as the only statement that compiles.
upvoted 1 times
...
juversg
1 year, 6 months ago
Selected Answer: C
I suppose the first option was meant to look like this: var var1 = systemDateGet(); var1 = var1 ? today() : "Not today"; Then Visual Studio shows the following error: cannot implicitly convert from type 'str' to type 'date'. So the correct answer is C.
upvoted 3 times
...
jorgkpo
1 year, 11 months ago
***A***
upvoted 1 times
...
makarsharl
2 years, 2 months ago
Selected Answer: C
Correct answer
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago