nerdexam
Microsoft

MB-500 · Question #195

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 paramet

Sign in or unlock MB-500 to reveal the answer and full explanation for question #195. The question stem and answer options stay visible for context.

Develop business logic

Question

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.

Exhibits

MB-500 question #195 exhibit 1
MB-500 question #195 exhibit 2
MB-500 question #195 exhibit 3
MB-500 question #195 exhibit 4

Options

  • Apublic int calc(int _value) { if (_value > 10) { throw error('The value cannot be greater than 10.'); } int ret = next calc(_value); return ret; }
  • Bpublic int calc(int _value) { if (_value > 10) { throw error('The value cannot be greater than 10.'); } }
  • Cpublic int calc(int _value) { int ret = next calc(_value); if (_value > 10) { throw error('The value cannot be greater than 10.'); } return ret; }
  • Dpublic int calc(int _value) { int ret; if (_value <= 10) { ret = next calc(_value); } return ret; }

Unlock MB-500 to see the answer

You've previewed enough free MB-500 questions. Unlock MB-500 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#class extension#chain of command#method override#X++ extension
Full MB-500 Practice