exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 57 discussion

Actual exam question from Microsoft's 70-483
Question #: 57
Topic #: 1
[All 70-483 Questions]

You are testing an application. The application includes methods named CalculateInterest and LogLine.
The CalculateInterest() method calculates loan interest. The LogLine() method sends diagnostic messages to a console window.
The following code implements the methods. (Line numbers are included for reference only.)

You have the following requirements:
✑ The Calculatelnterest() method must run for all build configurations.
✑ The LogLine() method must run only for debug builds.
You need to ensure that the methods run correctly.
What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

  • A. Insert the following code segment at line 01: #region DEBUG Insert the following code segment at line 10: #endregion
  • B. Insert the following code segment at line 10: [Conditional(MDEBUG")]
  • C. Insert the following code segment at line 05: #region DEBUG Insert the following code segment at line 07: #endregion
  • D. Insert the following code segment at line 01: #if DE30G Insert the following code segment at line 10 :#endif
  • E. Insert the following code segment at line 01: [Conditional(MDEBUG")]
  • F. Insert the following code segment at line 05 :#if DEBUG Insert the following code segment at line 07: #endif
  • G. Insert the following code segment at line 10: [Conditional("RELEASE")]
Show Suggested Answer Hide Answer
Suggested Answer: BF 🗳️
#if DEBUG: The code in here won't even reach the IL on release.
[Conditional("DEBUG")]: This code will reach the IL, however the calls to the method will not execute unless DEBUG is on.
References: http://stackoverflow.com/questions/3788605/if-debug-vs-conditionaldebug

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
StudiousMCSD
Highly Voted 5 years, 7 months ago
B says: [Conditional(MDEBUG")] That should be: [Conditional("DEBUG")]
upvoted 21 times
...
zzMichielzz
Most Recent 4 years, 8 months ago
B (Yes a " in place of M) and F
upvoted 1 times
...
mmarinov
5 years, 1 month ago
The [Conditional("DEBUG")] is not needed.
upvoted 2 times
Kilsimon
4 years, 8 months ago
"Each correct answer presents a complete solution. Choose two." So yes, you can do it without, but you can also do it with.
upvoted 5 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 ...