PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which code segment should you insert at line 04?

You are implementing a method named FloorTemperature that performs conversions between value types and
reference types. The following code segment implements the method. (Line numbers are included for reference
only.)

You need to ensure that the application does not throw exceptions on invalid conversions.
Which code segment should you insert at line 04?

What are two possible ways to achieve this goal?

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.)

You need to meet the requirements

You are debugging an application that calculates loan interest. The application includes the following code.
(Line numbers are included for reference only.)

You have the following requirements:
The debugger must break execution within the Calculatelnterest() method when the loanAmount variable is
less than or equal to zero.
The release version of the code must not be impacted by any changes.
You need to meet the requirements.
What should you do?

Which collection type should you use?

You are developing an application that includes a class named Order. The application will store a collection of
Order objects.
The collection must meet the following requirements:
Internally store a key and a value for each collection item.
Provide objects to iterators in ascending order based on the key.Ensure that item are accessible by zero-based index or by key.
You need to use a collection type that meets the requirements.
Which collection type should you use?

Which code segment should you insert at line 20?

You are developing an application. The application converts a Location object to a string by using a methodnamed WriteObject.
The WriteObject() method accepts two parameters, a Location object and an XmlObjectSerializer object.
The application includes the following code. (Line numbers are included for reference only.)

You need to serialize the Location object as XML.
Which code segment should you insert at line 20?


Page 385 of 6,830« First...102030...383384385386387...390400410...Last »