Exam 70-483 Topic 7 Question 49 Discussion
Actual exam question for Microsoft's 70-483 exam
Question #: 49
Topic #: 7
Question #: 49
Topic #: 7
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.)
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.)
Suggested Answer: B,F Vote an answer
Explanation/Reference:
Explanation:
#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
Explanation:
#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
by Mike at Feb 26, 2024, 01:14 PM
0
0
0
10
Comments
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.
Report Comment
Commenting
You can sign-up / login (it's free).