How should you complete the relevant code?
DRAG DROP
You are developing an application that includes a class named Customer.
The application will output the Customer class as a structured XML document by using the following
code segment:
You need to ensure that the Customer class will serialize to XML.
How should you complete the relevant code? (To answer, drag the appropriate code segments to
the correct locations in the answer are
a Each code segment may be used once, more than once, or not at all. You may need to drag the
split bar between panes or scroll to view content.)
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
method named 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?
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 add at line 19?
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 code segment should you use?
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.)
Which code segment should you insert at line 16?
You are developing a method named CreateCounters that will create performance counters for an
application. The method includes the following code. (Line numbers are included for reference only.)
You need to ensure that Counter2 is available for use in Windows Performance Monitor (PerfMon).
Which code segment should you insert at line 16?
Which algorithm should you use?
You are developing an application that will transmit large amounts of data between a client
computer and a server. You need to ensure the validity of the data by using a cryptographic hashing
algorithm. Which algorithm should you use?
Which garbage collector method should you use?
You are developing an application by using C#.
The application includes an object that performs a long running process.
You need to ensure that the garbage collector does not release the object’s resources until the
process completes.
Which garbage collector method should you use?