exam questions

Exam MB-500 All Questions

View all questions & answers for the MB-500 exam

Exam MB-500 topic 3 question 59 discussion

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

A company uses Dynamics 365 Finance.

You implement an extension of a method named calc in ClassA. The calc method:

• Accepts an integer as an input parameter.
• Returns an integer as an output parameter.

You must implement an extension to:

• Extend the calc method.
• Prevent the standard code from running if the value of the input parameter is greater than 10.

You need to implement the correct solution.

Which code segment should you use?

  • A.
  • B.
  • C.
  • D.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
theCoder1
9 months, 3 weeks ago
(D) not correct because Calls to next can't be done conditionally inside an if statement. (B) not correct because not call next (C) not correct because call next first and call next after throw error then the correct answer A
upvoted 4 times
...
crispybacon
1 year ago
There are no correct answers no? In my understanding, since the requirement is to prevent the standard code from running if the value of the input parameter is greater than 10, there should be an else block containing the next calc() method that will run the standard code. Otherwise, the code on A will just throw an error then run the standard code regardless if the if the value is greater than 10. Please correct me if I'm wrong...
upvoted 2 times
viki_111
1 year ago
In this case when an exception is thrown, no further method code is executed, there is no try/catch construction.
upvoted 3 times
crispybacon
12 months ago
I see, I get it now... Thank you very much :)
upvoted 1 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