70-483 242 Q&S Programming in C#

How should you complete the code?

DRAG DROP
You have a class named Customer and a class named Order.
The customer class has a property named Orders that contains a list of Order objects.
The Order class has a property named OrderDate that contains the date of the Order.
You need to create a LINQ query that returns all of the customers who had at least one order during the year 2005. You write the following code.

How should you complete the code? To answer, drag the appropriate code elements to the correct targets in the answer area. Each code element 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.
Select and Place:



Answer Clike
HOTSPOT

HOTSPOT
You are building an application in Microsoft Visual Studio 2013.
You have the following code.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:



Answer Clike
HOTSPOT

HOTSPOT
You have the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:



Answer Clike
Which class should you use?

You have a C# application.
The application requires 500 MB of available memory.
You need to identify whether there is enough available memory when the application starts.
Which class should you use?
A. OutOfmemoryException
B. MemoryStream
C. PerformanceCounter
D. DiagnosticsConfigurationHandler


Answer Clike
How should you complete the code?

DRAG DROP
You are developing a function that takes a parameter named aParam as a string input.
You need to convert aParam to a Double. If the conversion cannot be completed, the function should return 0.

How should you complete the code? To answer, drag the appropriate code elements to the correct targets in the answer area. Each code element 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.
Select and Place:



Answer Clike
Which code should you insert at line 03?

You are creating a console application named Appl.
App1 retrieves data from the Internet by using JavaScript Object Notation (JSON).
You are developing the following code segment (line numbers are included for reference only):

You need to ensure that the code validates the JSON string.
Which code should you insert at line 03?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
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 CalculateInterest() 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 01:
[Conditional(“DEBUG”)]
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 10:
[Conditional(“DEBUG”)]
E. Insert the following code segment at line 01:
#if DEBUG
Insert the following code segment at line 10:
#endif
F. Insert the following code segment at line 10:
[Conditional(“RELEASE”)]
G. Insert the following code segment at line 05:
#if DEBUG
Insert the following code segment at line 07:
#endif


Answer Clike
Which line of code should you use?

You have a class named Customer and a variable named customers.
You need to test whether the customers’ variable is a generic list of Customer objects.
Which line of code should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code should you use?

DRAG DROP
You have the following code.
string MessageString = ?his is the original message!?
You need to store the SHA1 hash value of MessageString in a variable named HashValue.
Which code should you use? Develop the solution by selecting and arranging the required code blocks in the correct order. You may not need all of the code blocks.

Select and Place:


Answer Clike
What should you do?

You are creating an application that reads from a database.
You need to use different databases during the development phase and the testing phase by using conditional compilation techniques.
What should you do?
A. Configure the Define TRACE constant setting in Microsoft Visual Studio.
B. Specify the /define compiler option.
C. Run the Assembly Linker tool from the Windows Software Development Kit (Windows SDK).
D. Decorate the code by using the [assembly:AssemblyDelaySignAttribute(true)] attribute.


Answer Clike
Which code should you insert at line 07?

You write the following method (line numbers are included for reference only):

You need to ensure that the method extracts a list of URLs that match the following pattern:
@http://(www.)?([^.]+).com;
Which code should you insert at line 07?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
DRAG DROP

DRAG DROP
You are developing an application that implements a set of custom exception types. You declare the custom exception types by using the following code segments:

The application includes a function named DoWork that throws .NET Framework exceptions and custom exceptions. The application contains only the following logging methods:

The application must meet the following requirements:
When ContosoValidationException exceptions are caught, log the information by using the static void Log (ContosoValidationException ex) method.
When ContosoDbException or other ContosoException exceptions are caught, log the information by using the static void Log(ContosoException ex) method.
You need to meet the requirements.
You have the following code:

Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer, drag the appropriate code segments to the correct targets in the answer area. 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.)
Select and Place:



Answer Clike
Which code should you use?

You need to write a console application that meets the following requirements:
If the application is compiled in Debug mode, the console output must display Entering debug mode.
If the application is compiled in Release mode, the console output must display Entering release mode.
Which code should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
How should you complete the code?

DRAG DROP
You write the following code.

You need to get the list of all the types defined in the assembly that is being executed currently.
How should you complete the code? To answer, drag the appropriate code elements to the correct targets in the answer area. Each code element 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.
Select and Place:



Answer Clike
Which code segment should you use?

You are developing an application that includes methods named ConvertAmount and TransferFunds.
You need to ensure that the precision and range of the value in the amount variable is not lost when the TransferFunds() method is called.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
HOTSPOT

HOTSPOT
A developer designs an interface that contains the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:



Answer Clike
What should you do?

You have the following code (line numbers are included for reference only):

You need to ensure that new instances of Connection can be created only by other classes by calling the Create method. The solution must allow classes to inherit from Connection.
What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code should you insert at line 16?

DRAG DROP
You have the following class. (Line numbers are included for reference only.)

You need to complete the doOperation method to meet the following requirements:
If AddNumb is passed as the operationName parameter, the AddNumb function is called.
If SubNumb is passed as the operationName parameter, the SubNumb function is called.
Which code should you insert at line 16? Develop the solution by selecting and arranging the required code blocks in the correct order. You may not need all of the code blocks.
Select and Place:



Answer Clike
Which code segments should you include in Target 1 and Target 2 to complete the code?

DRAG DROP
You are creating a class named Data that includes a dictionary object named _data.
You need to allow the garbage collection process to collect the references of the _data object.
You have the following code:

Which code segments should you include in Target 1 and Target 2 to complete the code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code?

DRAG DROP
You are developing a class named Temperature.
You need to ensure that collections of Temperature objects are sortable. You have the following code:

Which code segments should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer, drag the appropriate code segments to
the correct targets in the answer area. 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.)
Select and Place:



Answer Clike
What should you do?

You are developing an application that contains a class named TheaterCustomer and a method named ProcessTheaterCustomer. The ProcessTheaterCustomer() method accepts a TheaterCustomer object as the input parameter.
You have the following requirements:
Store the TheaterCustomer objects in a collection.
Ensure that the ProcessTheaterCustomer() method processes the TheaterCustomer objects in the reverse order in which they are placed into the collection.
You need to meet the requirements.
What should you do?
A. Create a System.Collections.Queue collection. Use the Enqueue() method to add TheaterCustomer objects to the collection. Use the Dequeue() method to pass the objects to the ProcessTheaterCustomer() method.
B. Create a System.Collections.ArrayList collection. Use the Insert() method to add TheaterCustomer objects to the collection. Use the Remove() method to pass the objects to the ProcessTheaterCustomer() method.
C. Create a System.Collections.Stack collection. Use the Push() method to add TheaterCustomer objects to the collection. Use the Pop() method to pass the objects to the ProcessTheaterCustomer() method.
D. Create a System.Collections.Queue collection. Use the Enqueue() method to add TheaterCustomer objects to the collection. Use the Peek() method to pass the objects to the ProcessTheaterCustomer() method.


Answer Clike
Which code should you insert at line 12?

You have the following code. (Line numbers are included for reference only).

You need to complete the WriteTextAsync method. The solution must ensure that the code is not blocked while the file is being written. Which code should you insert at line 12?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which type of object should you use in the method?

You need to write a method that retrieves data from a Microsoft Access 2013 database. The method must meet the following requirements:
Be read-only.
Be able to use the data before the entire data set is retrieved.
Minimize the amount of system overhead and the amount of memory usage.
Which type of object should you use in the method?
A. DbDataAdapter
B. unTyped DataSet
C. OleDbDataAdapter
D. DbDataReader


Answer Clike
Which code should you use?

You have the following code:

You need to retrieve all of the numbers from the items variable that are greater than 80.
Which code should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which attributes should you include in Target 1, Target 2 and Target 3 to complete the code?

DRAG DROP
An application serializes and deserializes XML from streams. The XML streams are in the following format:

The application reads the XML streams by using a DataContractSerializer object that is declared by the following code segment:

You need to ensure that the application preserves the element ordering as provided in the XML stream.
You have the following code:

Which attributes should you include in Target 1, Target 2 and Target 3 to complete the code? (To answer, drag the appropriate attributes to the correct targets in the answer area. Each attribute 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.)
Select and Place:



Answer Clike
What should you do?

When you execute the code, you get an exception.

You need to ensure that B_Products contain all of the products that start with the letter “B”.
What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segments should you include in Target 1, Target 2, Target 3 and Target 4 to complete the code?

DRAG DROP
You are developing a C# application. The application includes a class named Rate. The following code segment implements the Rate class:

You define a collection of rates named rateCollection by using the following code segment: Collection rateCollection = new Collection() ;
The application receives an XML file that contains rate information in the following format:

You need to parse the XML file and populate the rateCollection collection with Rate objects.
You have the following code:

Which code segments should you include in Target 1, Target 2, Target 3 and Target 4 to complete the code? (To answer, drag the appropriate code segments to the correct targets in the answer area. 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.)
Select and Place:



Answer Clike
Which code segment should you use?

You are modifying an existing application.
The application includes a Loan class and a Customer class. The following code segment defines the classes.

You populate a collection named customer-Collection with Customer and Loan objects by using the following code segment:

You create a largeCustomerLoans collection to store the Loan objects by using the following code segment: Collection largeCustomerLoans = new Collection();
All loans with an Amount value greater than or equal to 4000 must be tracked.
You need to populate the largeCustomerLoans collection with Loan objects.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
How should you complete the code?

DRAG DROP
You have the following code.

You need to return all of the products and their associated categories.
How should you complete the code? To answer, drag the appropriate code elements to the correct targets in the answer area. Each code element 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.
Select and Place:



Answer Clike
Which two sets of method signatures can you use to achieve this goal?

You are developing an application that will manage customer records. The application includes a method named FindCustomer.
Users must be able to locate customer records by using the customer identifier or customer name. You need to implement the FindCustomer() method to meet the requirement.
Which two sets of method signatures can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you include in the code?

You need to write a method that combines an unknown number of strings. The solution must minimize the amount of memory used by the method when the method executes.
What should you include in the code?
A. The String.Concat method
B. The StringBuilder.Append method
C. The + operator
D. The += operator


Answer Clike
Which code segment should you use?

You are implementing a method named ProcessFile that retrieves data files from web servers and FTP servers. The ProcessFile () method has the following method signature:
Public void ProcessFile(Guid dataFileld, string dataFileUri)
Each time the ProcessFile() method is called, it must retrieve a unique data file and then save the data file to disk. You need to complete the implementation of the ProcessFile() method. Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you do?

You are creating a class library that will be used in a web application.
You need to ensure that the class library assembly is strongly named.
What should you do?
A. Use assembly attributes.
B. Use the csc.exe /target:Library option when building the application.
C. Use the xsd.exe command-line tool.
D. Use the EdmGen.exe command-line tool.


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are developing a C# application. The application includes a class named Rate. The following code segment implements the Rate class:

You define a collection of rates named rateCollection by using the following code segment: Collection rateCollection = new Collection() ;
The application receives an XML file that contains rate information in the following format:

You need to parse the XML file and populate the rateCollection collection with Rate objects.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which four code segments should you insert in sequence at line 03?

DRAG DROP
You are developing an application that will write string values to a file. The application includes the following code segment. (Line numbers are included for reference only.)
01 protected void ProcessFile(string fileName, string value) 02 {
3
04 }
You need to ensure that the ProcessFile() method will write string values to a file.
Which four code segments should you insert in sequence at line 03? (To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.)
Select and Place:



Answer Clike
Which code should you use?

You need to write a console application that meets the following requirements:
If the application is compiled in Debug mode, the console output must display Entering debug mode.
If the application is compiled in Release mode, the console output must display Entering release mode.
Which code should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use?

You are developing an application by using C#. The application will write events to an event log. You plan to deploy the application to a server.
You create an event source named AppSource and a custom log named AppLog on the server. You need to write events to the custom log.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you insert at line 16?

You are developing a C# application. The application includes the following code segment, (Line numbers are included for reference only.)

The application fails at line 17 with the following error message: “An item with the same key has already been added.”
You need to resolve the error.
Which code segment should you insert at line 16?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two code segments can you use to achieve this goal?

You are developing an application by using C#. The application includes a method named SendMessage. The SendMessage() method requires a string input.
You need to replace “Hello” with “Goodbye” in the parameter that is passed to the SendMessage() method.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two code segments should you use?

You are developing an application that includes the following code segment:

You need to implement both Start() methods in a derived class named UseStart that uses the Start() method of each interface. Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
F. Option F


Answer Clike
Which code segment should you insert at line 09?

You are developing an application that will use multiple asynchronous tasks to optimize performance.
You create three tasks by using the following code segment. (Line numbers are included for reference only.)

You need to ensure that the ProcessTasks() method waits until all three tasks complete before continuing.
Which code segment should you insert at line 09?
A. Task.WaitFor(3);
B. tasks.Yield();
C. tasks.WaitForCompletion();
D. Task.WaitAll(tasks);


Answer Clike
What should you do?

You are evaluating a method that calculates loan interest. The application includes the following code segment. (Line numbers are included for reference only.)

When the loanTerm value is 5 and the loanAmount value is 4500, the loanRate must be set to 6.5 percent.
You need to adjust the loanRate value to meet the requirements.
What should you do?
A. Replace line 15 with the following code segment: loanRate = 0.065m;
B. Replace line 07 with the following code segment: loanRate = 0.065m;
C. Replace line 17 with the following code segment: interestAmount = loanAmount * 0.065m * loanTerm;
D. Replace line 04 with the following code segment: decimal loanRate = 0.065m;


Answer Clike
Which code segment should you use?

You are developing an application that includes a class named Customer and a generic list of customers. The following code segment declares the list of customers:
List customersList = new List () ;
You populate the customersList object with several hundred Customer objects.
The application must display the data for five Customer objects at a time.
You need to create a method that will return the correct number of Customer objects.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you do?

You are debugging a 64-bit C# application.
Users report System.OutOfMemoryException exceptions. The system is attempting to use arrays larger than 2 GB in size. You need to ensure that the application can use arrays larger than 2 GB.
What should you do?
A. Add the /3GB switch to the boot.ini file for the operating system.
B. Set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the image header for the application executable file.
C. Set the value of the gcAllowVeryLargeObjects property to true in the application configuration file.
D. Set the value of the user-mode virtual address space setting for the operating system to MAX.


Answer Clike
Which code segment should you insert at line 23?

You develop an application by using C#. The application counts the number of times a specific word appears within a set of text files. The application includes the following code. (Line numbers are included for reference only.)

You have the following requirements:
Populate the _wordCounts object with a list of words and the number of occurrences of each word.
Ensure that updates to the ConcurrentDictionary object can happen in parallel.
You need to complete the relevant code.
Which code segment should you insert at line 23?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two assembly identity attributes should you include in the source code?

You are developing an application that will be deployed to multiple computers. You set the assembly name.
You need to create a unique identity for the application assembly.
Which two assembly identity attributes should you include in the source code? (Each correct answer presents part of the solution. Choose two.)
A. AssemblyDelaySignAttribute
B. AssemblyCompanyAttribute
C. AssemblyProductAttribute
D. AssemblyCultureAttribute
E. AssemblyVersionAttribute


Answer Clike
What should you do?

You are developing an application that contains a class named TheaterCustomer and a method named ProcessTheaterCustomer. The ProcessTheaterCustomer() method accepts a TheaterCustomer object as the input parameter.
You have the following requirements:
Store the TheaterCustomer objects in a collection.
Ensure that the ProcessTheaterCustomer() method processes the TheaterCustomer objects in the order in which they are placed into the collection.
You need to meet the requirements.
What should you do?
A. Create a System.Collections.Stack collection. Use the Push() method to add TheaterCustomer objects to the collection, Use the Peek() method to pass the objects to the ProcessTheaterCustomer() method.
B. Create a System.Collections.Queue collection. Use the Enqueue() method to add TheaterCustomer objects to the collection. Use the Dequeue() method to pass the objects to the ProcessTheaterCustomer() method.
C. Create a System.Collections.SortedList collection. Use the Add() method to add TheaterCustomer objects to the collection. Use the Remove() method to pass the objects to the ProcessTheaterCustomer() method.
D. Create a System.Collections.ArrayList collection. Use the Insert() method to add TheaterCustomer objects to the collection. Use the Remove() method to pass the objects to the ProcessTheaterCustomer() method.


Answer Clike
What should you do?

You are creating an application that processes a list of numbers.
The application must define a method that queries the list and displays a subset of the numbers to the user. The method must not update the list. You need to create an extendable query by using LINQ.
What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use?

You are developing an application that includes methods named EvaluateLoan, ProcessLoan, and FundLoan. The application defines build configurations named TRIAL, BASIC, and ADVANCED.
You have the following requirements:
The TRIAL build configuration must run only the EvaluateLoan() method.
The BASIC build configuration must run all three methods.
The ADVANCED build configuration must run only the EvaluateLoan() and ProcessLoan() methods.
You need to meet the requirements.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which form should you implement the rate member?

You are creating a class named Loan.
The Loan class must meet the following requirements:
Include a member that represents the rate for a Loan instance.
Allow external code to assign a value to the rate member.
Restrict the range of values that can be assigned to the rate member.
You need to implement the rate member to meet the requirements.
In which form should you implement the rate member?
A. public static property
B. public property
C. public static field
D. protected field


Answer Clike
What should you do?

You are creating a class library that will be used in a web application.
You need to ensure that the class library assembly is strongly named.
What should you do?
A. Use the csc.exe /target:Library option when building the application.
B. Use the AL.exe command-line tool.
C. Use the aspnet_regiis.exe command-line tool.
D. Use the EdmGen.exe command-line tool.


Answer Clike
Which code should you insert at line 03?

You are creating a console application named App1.
App1 retrieves data from the Internet by using JavaScript Object Notation (JSON). You are developing the following code segment (line numbers are included for reference only):

You need to ensure that the code validates the JSON string. Which code should you insert at line 03?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two code segments can you use to achieve this goal?

You are implementing a method named GetValidPhoneNumbers. The GetValidPhoneNumbers() method processes a list of string values that represent phone numbers.
The GetValidPhoneNumbers() method must return only phone numbers that are in a valid format. You need to implement the GetValidPhoneNumbers() method.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which four code segments should you insert in sequence at line 03?

DRAG DROP
You are developing an application that will write data to a file. The application includes the following code segment. (Line numbers are included for reference only.)
You need to ensure that the WriteData() method will write data to a file.
Which four code segments should you insert in sequence at line 03? (To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.)
Select and Place:



Answer Clike
What should you use?

You need to create a method that can be called by using a varying number of parameters.
What should you use?
A. derived classes
B. interface
C. enumeration
D. method overloading


Answer Clike
What should you do?

You are creating an application that reads from a database.
You need to use different databases during the development phase and the testing phase by using conditional compilation techniques.
What should you do?
A. Configure the Define TRACE constant setting in Microsoft Visual Studio.
B. Decorate the code by using the [DebuggerDisplay(“Mydebug”)] attribute.
C. Configure the Define DEBUG constant setting in Microsoft Visual Studio.
D. Disable the strong-name bypass feature of Microsoft .NET Framework in the registry.


Answer Clike
Which line should you insert the code?

You are developing an application in C#.
The application uses exception handling on a method that is used to execute mathematical calculations by using integer numbers. You write the following catch blocks for the method (line numbers are included for reference only):

You need to add the following code to the method:

At which line should you insert the code?
A. 01
B. 03
C. 05
D. 07


Answer Clike
Which code segment should you use?

You are developing an application that uses multiple asynchronous tasks to optimize performance. The application will be deployed in a distributed environment.
You need to retrieve the result of an asynchronous task that retrieves data from a web service. The data will later be parsed by a separate task.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use in the method body?

You are implementing a method named ProcessData that performs a long-running task. The ProcessData() method has the following method signature: public void ProcessData(List values, CancellationTokenSource source, CancellationToken token)
If the calling code requests cancellation, the method must perform the following actions:
Cancel the long-running task.
Set the task status to TaskStatus.Canceled.
You need to ensure that the ProcessData() method performs the required actions.
Which code segment should you use in the method body?
A. if (token.IsCancellationRequested) return;
B. throw new AggregateException();
C. token.ThrowIfCancellationRequested();
D. source.Cancel();


Answer Clike
HOTSPOT

HOTSPOT
You have the following code (line numbers are included for reference only):

To answer, complete each statement according to the information presented in the code.
Hot Area:



Answer Clike
Which code segment should you insert at line 05?

You are developing a method named GetHash that will return a hash value for a file. The method includes the following code. (Line numbers are included for reference only.)

You need to return the cryptographic hash of the bytes contained in the fileBytes variable.
Which code segment should you insert at line 05?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two code segments should you use?

You are developing an application that includes the following code segment:

You need to implement the Open() method of each interface in a derived class named UseResources and call the Open() method of each interface.
Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are adding a method to an existing application. The method uses an integer named statusCode as an input parameter and returns the status code as a string.
The method must meet the following requirements:
Return “Error” if the statusCode is 0.
Return “Success” if the statusCode is 1.
Return “Unauthorized” if the statusCode is any value other than 0 or l.
You need to implement the method to meet the requirements.
How should you complete the relevant code? (To answer, drag the appropriate statements to the correct locations in the answer area. Each statement 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.)
Select and Place:



Answer Clike
What should you do?

You have the following class (line numbers are included for reference only):

ServiceProxy is a proxy for a web service. Calls to the Update method can take up to five seconds. The Test class is the only class the uses Class1. You run the Execute method three times, and you receive the following results:
213
312
231
You need to ensure that each value is appended to the Value property in the order that the Modify methods are invoked.
What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code should you use?

You need to write a console application that meets the following requirements:
If the application is compiled in Debug mode, the console output must display Entering debug mode.
If the application is compiled in Release mode, the console output must display Entering release mode.
Which code should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
HOTSPOT

HOTSPOT
You have an existing order processing system that accepts .xml files,
The following code shows an example of a properly formatted order in XML:

You create the following class that will be serialized:

For each of the following properties, select Yes if the property is serialized according to the defined schema. Otherwise, select No.
Hot Area:



Answer Clike
Which code segment should you use?

You are developing an application that includes methods named ConvertAmount and TransferFunds.
You need to ensure that the precision and range of the value in the amount variable is not lost when the TransferFunds() method is called.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which keyword should you use?

You are developing a class named Account that will be used by several applications.
The applications that will consume the Account class will make asynchronous calls to the Account class to execute several different methods. You need to ensure that only one call to the methods is executed at a time.
Which keyword should you use?
A. sealed
B. protected
C. checked
D. lock


Answer Clike
Which code segment should you use?

You are developing an application by using C#. The application will write events to an event log. You plan to deploy the application to a server.
You create an event source named MySource and a custom log named MyLog on the server. You need to write events to the custom log.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which cryptographic algorithm should you use?

You plan to store passwords in a Windows Azure SQL Database database.
You need to ensure that the passwords are stored in the database by using a hash algorithm, Which cryptographic algorithm should you use?
A. ECDSA
B. RSA-768
C. AES-256
D. SHA-256


Answer Clike
Which two actions should you perform?

You are implementing a new method named ProcessData. The ProcessData() method calls a third-party component that performs a long-running operation to retrieve stock information from a web service.
The third-party component uses the IAsyncResult pattern to signal completion of the long- running operation so that the UI can be updated with the new values.
You need to ensure that the calling code handles the long-running operation as a System.Threading.Tasks.Task object to avoid blocking the UI thread. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Create a TaskCompletionSource<T> object.
B. Call the component by using the TaskFactory.FromAsync() method.
C. Apply the following attribute to the ProcessData() method signature: [Methodlmpl(MethodlmplOptions.Synchronized)]
D. Apply the async modifier to the ProcessData() method signature.


Answer Clike
Which code should you insert at line 07?

You write the following method (line numbers are included for reference only):

You need to ensure that the method extracts a list of URLs that match the following pattern:
@http://(www.)?([^.]+).com;
Which code should you insert at line 07?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code should you use?

You have the following code:

You need to retrieve all of the numbers from the items variable that are greater than 80.
Which code should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you insert at line 03?

You are developing an application that uses several objects. The application includes the following code segment. (Line numbers are included for reference only.)

You need to evaluate whether an object is null.
Which code segment should you insert at line 03?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code should you insert at line 28?

You have the following code (line numbers are included for reference only):

You need to ensure that if an exception occurs, the exception will be logged.
Which code should you insert at line 28?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you insert at line 09?

You are troubleshooting an application that uses a class named FullName. The class is decorated with the DataContractAttribute attribute. The application includes the following code. (Line numbers are included for reference only.)

You need to ensure that the entire FullName object is serialized to the memory stream object.
Which code segment should you insert at line 09?
A. binary.WriteEndElement();
B. binary.NriteEndDocument();
C. ms.Close() ;
D. binary.Flush();


Answer Clike
What should you do?

You are developing an assembly.
You plan to sign the assembly when the assembly is developed.
You need to reserve space in the assembly for the signature.
What should you do?
A. Run the Assembly Linker tool from the Windows Software Development Kit (Windows SDK).
B. Run the Strong Name tool from the Windows Software Development Kit (Windows SDK).
C. Add the AssemblySignatureKeyAttribute attribute the assembly.
D. Add the AssemblyDelaySignAttribute attribute to the assembly.


Answer Clike
Which code should you use?

You have an application that accesses a Web server named Server1.
You need to download an image named Imagel.jpg from Server1 and store the image locally as Filel.jpg.
Which code should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use?

You are developing a C# application. The application references and calls a RESTful web service named EmployeeService. The EmployeeService web service includes a method named GetEmployee, which accepts an employee ID as a parameter. The web service returns the following JSON data from
the method.
{“Id”:1,”Name”:”David Jones”>
The following code segment invokes the service and stores the result:

You need to convert the returned JSON data to an Employee object for use in the application.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two code segments can you use to achieve this goal?

You are developing an application that includes a method named SendMessage.
You need to ensure that the SendMessage() method is called with the required parameters.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you do?

You are developing an application.
The application contains the following code:

When you compile the code, you receive the following syntax error message: “A previous catch clause already catches all exceptions of this or a super type (‘System.Exception’).”
You need to ensure that the code can be compiled. What should you do?
A. Catch the ArgumentException exception instead of the ArgumentNullException exception.
B. Throw a new exception in the second catch block.
C. Catch the ArgumentNullException exception first.
D. Re-throw the exception caught by the second catch block.


Answer Clike
What should you do?

DRAG DROP
You have a method that will evaluate a parameter of type Int32 named Status.
You need to ensure that the method meets the following requirements: If Status is set to Active, the method must return 1.
If Status is set to Inactive, the method must return 0.
If Status is any other value, the method must return -1.
What should you do? (To answer, drag the appropriate statement to the correct location in the answer area. Each statement 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.)
Select and Place:



Answer Clike
Which code segment should you use?

You are developing an application that uses multiple asynchronous tasks to optimize performance.
You need to retrieve the result of an asynchronous task.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which commands should you run?

DRAG DROP
You create an assembly named Assembly1.dll.
You need to ensure that Assembly1.dll can be deployed to the global assembly cache (GAC).
Which commands should you run? (To answer, drag the appropriate programs to the correct locations. Each program 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.)
Select and Place:



Answer Clike
DRAG DROP

DRAG DROP
You have an application that accesses a Microsoft SQL Server database.
The database contains a stored procedure named Proc1. Proc1 accesses several rows of data across multiple tables.
You need to ensure that after Proc1 executes, the database is left in a consistent state. While Proc1 executes, no other operation can modify data already read or changed by Proc1. (Develop the solution by selecting and ordering the required code snippets.
You may not need all of the code snippets.)
Select and Place:



Answer Clike
DRAG DROP

DRAG DROP
You have an application that uses paging. Each page displays 10 items from a list.
You need to display the third page. (Develop the solution by selecting and ordering the required code snippets. You may not need all of the code snippets.)
Select and Place:



Answer Clike
Which two code segments can you insert at line 05 to achieve this goal?

You are developing an application that generates code. The application includes the following code segment. (Line numbers are included for reference only.)

You need to ensure that code generated by the GenerateCode() method represents a class that can be accessed by all objects in its application domain.
Which two code segments can you insert at line 05 to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which class should you use?

You are developing an application that will process personnel records.
The application must encrypt highly sensitive data.
You need to ensure that the application uses the strongest available encryption.
Which class should you use?
A. System.Security.Cryptography.DES
B. System.Security.Cryptography.Aes
C. System.Security.Cryptography.TripleDES
D. System.Security.Cryptography.RC2


Answer Clike
What should you include in the application code?

You are developing an application that uses a .config file.
The relevant portion of the .config file is shown as follows:

You need to ensure that diagnostic data for the application writes to the event log by using the configuration specified in the .config file.
What should you include in the application code?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use?

You are developing an application that includes a class named Employee and a generic list of employees. The following code segment declares the list of employees:
List employeesList = new List();
You populate the employeesList object with several hundred Employee objects.
The application must display the data for five Employee objects at a time.
You need to create a method that will return the correct number of Employee objects.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you insert at line 14?

An application contains code that measures reaction times. The code runs the timer on a thread separate from the user interface. The application includes the following code. (Line numbers are included for reference only.)

You need to ensure that the application cancels the timer when the user presses the Enter key.
Which code segment should you insert at line 14?
A. tokenSource.Token.Register( () => tokenSource.Cancel() );
B. tokenSource.Cancel();
C. tokenSource.IsCancellationRequested = true;
D. tokenSource.Dispose();


Answer Clike
Which two actions should you perform?

You are implementing a new method named ProcessData. The ProcessData() method calls a third-party component that performs a long-running operation.
The third-party component uses the IAsyncResult pattern to signal completion of the long- running operation.
You need to ensure that the calling code handles the long-running operation as a System.Threading.Tasks.Task object.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Call the component by using the TaskFactory.FromAsync() method.
B. Create a TaskCompletionSource<T> object.
C. Apply the async modifier to the method signature.
D. Apply the following attribute to the method signature: [MethodImpl(MethodImplOptions.Synchronized)]


Answer Clike
Which code segment should you use?

You are developing an application for a bank. The application includes a method named ProcessLoan that processes loan applications. The ProcessLoan() method uses a method named CalculateInterest. The application includes the following code:

You need to declare a delegate to support the ProcessLoan() method.
Which code segment should you use?
219-vceguide
A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two actions should you perform?

You are modifying an application that processes loans. The following code defines the Loan class. (Line numbers are included for reference only.)

Loans are restricted to a maximum term of 10 years. The application must send a notification message if a loan request exceeds 10 years.
You need to implement the notification mechanism.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you do?

You are evaluating a method that calculates loan interest- The application includes the following code segment. (Line numbers are included for reference only.)

When the loanTerm value is 3 and the loanAmount value is 9750, the loanRate must be set to 8.25 percent.
You need to adjust the loanRate value to meet the requirements.
What should you do?
A. Replace line 04 with the following code segment: decimal loanRate = 0.0325m;
B. Replace line 17 with the following code segment: interestAmount = loanAmount * 0.0825m * loanTerm;
C. Replace line 15 with the following code segment: loanRate = 0.0825m;
D. Replace line 07 with the following code segment: loanRate = 0.0825m;


Answer Clike
Which code should you insert at line 03?

You are creating a console application named Appl.
App1 retrieves data from the Internet by using JavaScript Object Notation (JSON).
You are developing the following code segment (line numbers are included for reference only):

You need to ensure that the code validates the JSON string. Which code should you insert at line 03?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which type of object should you use in the method?

You need to write a method that retrieves data from a Microsoft Access 2013 database. The method must meet the following requirements:
Be read-only.
Be able to use the data before the entire data set is retrieved.
Minimize the amount of system overhead and the amount of memory usage.
Which type of object should you use in the method?
A. DbDataReader
B. DataContext
C. unTyped DataSet
D. DbDataAdapter


Answer Clike
HOTSPOT

HOTSPOT
You define a class by using the following code:

You write the following code for a method (line numbers are included for reference only):

To answer, complete each statement according to the information presented in the code.
Hot Area:



Answer Clike
Which code should you insert at line 03?

You are creating a console application named App1.
App1 will validate user input for order entries.
You are developing the following code segment (line numbers are included for reference only):

You need to complete the code segment.
The solution must ensure that prices are positive and have two decimal places.
Which code should you insert at line 03?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code should you insert at line 28?

You have the following code (line numbers are included for reference only):

You need to ensure that if an exception occurs, the exception will be logged.
Which code should you insert at line 28?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code should you use?

You have the following code:

You need to retrieve all of the numbers from the items variable that are greater than 80.
Which code should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you insert at line 09?

You are troubleshooting an application that uses a class named FullName. The class is decorated with the DataContractAttribute attribute. The application includes the following code. (Line numbers are included for reference only.)

You need to ensure that the entire FullName object is serialized to the memory stream object.
Which code segment should you insert at line 09?
A. binary.WriteEndDocument();
B. binary.WriteEndDocumentAsync();
C. binary.WriteEndElementAsync();
D. binary.Flush();


Answer Clike
HOTSPOT

HOTSPOT
You define a class by using the following code:

To answer, complete each statement according to the information presented in the code.
Hot Area:



Answer Clike
Which four lines of code should you use in sequence?

DRAG DROP
You are developing a C# console application that outputs information to the screen. The following code segments implement the two classes responsible for making calls to the Console object:

When the application is run, the console output must be the following text:
Log started
Base: Log continuing
Finished
You need to ensure that the application outputs the correct text.
Which four lines of code should you use in sequence? (To answer, move the appropriate classes from the list of classes to the answer area and arrange them in the correct order.)
Select and Place:



Answer Clike
What should you do?

You are creating an application that reads from a database.
You need to use different databases during the development phase and the testing phase by using conditional compilation techniques.
What should you do?
A. Configure the assembly metadata to use the pre-existing public key for the assembly identity by using the AssemblySignatureKeyAttribute attribute.
B. Disable the strong-name bypass feature of Microsoft .NET Framework in the registry.
C. Configure the Define DEBUG constant setting in Microsoft Visual Studio.
D. Decorate the code by using the [assembly:AssemblyDelaySignAttribute(true)] attribute.


Answer Clike
Which two code segments can you use to achieve this goal?

You are implementing a method named GetValidEmailAddresses. The GetValidEmailAddresses() method processes a list of string values that represent email addresses.
The GetValidEmailAddresses() method must return only email addresses that are in a valid format. You need to implement the GetValidEmailAddresses() method.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use?

You are modifying an existing banking application.
The application includes an Account class and a Customer class. The following code segment defines the classes.

You populate a collection named customerCollection with Customer and Account objects by using the following code segment:

You create a largeCustomerAccounts collection to store the Account objects by using the following code segment: Collection largeCustomerAccounts = new Collection ();
All accounts with a Balance value greater than or equal to 1,000,000 must be tracked. You need to populate the largeCustomerAccounts collection with Account objects.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you do?

You are developing an application that produces an executable named MyApp.exe and an assembly named MyApp.dll.
The application will be sold to several customers.
You need to ensure that enough debugging information is available for MyApp.exe, so that if the application throws an error in a customer’s environment, you can debug the error in your own development environment.
What should you do?
A. Digitally sign MyApp.dll.
B. Produce program database (PDB) information when you compile the code.
C. Compile MyApp.exe by using the /unsafe compiler option.
D. Initializes a new instance of the AssemblyDelaySignAttribute class in the MyApp.dll constructor.


Answer Clike
Which class should you use?

You have an application that will send confidential information to a Web server. You need to ensure that the data is encrypted when it is sent across the network.
Which class should you use?
A. CryptoStream
B. AuthenticatedStream
C. PipeStream
D. NegotiateStream


Answer Clike
What should you do?

You are developing a class named EmployeeRoster. The following code implements the EmployeeRoster class. (Line numbers are included for reference only.)

You create the following unit test method to test the EmployeeRoster class implementation:

You need to ensure that the unit test will pass.
What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use?

You are developing an application that retrieves patient data from a web service. The application stores the JSON messages returned from the web service in a string variable named PatientAsJson. The variable is encoded as UTF-8. The application includes a class named Patient that is defined by the following code:

You need to populate the Patient class with the data returned from the web service.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you insert at line 03?

You are developing a game that allows players to collect from 0 through 1000 coins. You are creating a method that will be used in the game. The method includes the following code. (Line numbers are included for reference only.)
01 public string FormatCoins(string name, int coins) 02 {
3
04 }
The method must meet the following requirements:
Return a string that includes the player name and the number of coins.
Display the number of coins without leading zeros if the number is 1 or greater.
Display the number of coins as a single 0 if the number is 0.
You need to ensure that the method meets the requirements.
Which code segment should you insert at line 03?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two actions should you perform?

An application is throwing unhandled NullReferenceException and FormatException errors. The stack trace shows that the exceptions occur in the GetWebResult() method.
The application includes the following code to parse XML data retrieved from a web service. (Line numbers are included for reference only.)

You need to handle the exceptions without interfering with the existing error-handling infrastructure.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which type of collection should you use?

You need to store the values in a collection.
The solution must meet the following requirements:
The values must be stored in the order that they were added to the collection.
The values must be accessed in a first-in, first-out order.
Which type of collection should you use?
A. SortedList
B. Queue
C. ArrayList
D. Hashtable


Answer Clike
What should you do?

You are creating a class library that will be used in a web application.
You need to ensure that the class library assembly is strongly named.
What should you do?
A. Use the gacutil.exe command-line tool.
B. Use the xsd.exe command-line tool.
C. Use the aspnet_regiis.exe command-line tool.
D. Use assembly attributes.


Answer Clike
Which code should you insert at line 28?

You have the following code (line numbers are included for reference only):

You need to ensure that if an exception occurs, the exception will be logged.
Which code should you insert at line 28?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code should you insert at line 07?

You write the following method (line numbers are included for reference only):

You need to ensure that the method extracts a list of URLs that match the following pattern:
@http://(www.)?([^.]+).com;
Which code should you insert at line 07?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code should you use to replace line 05?

You are developing an application.
The application contains the following code segment (line numbers are included for reference only):

When you run the code, you receive the following error message: “Cannot implicitly convert type ‘object” to ‘inf. An explicit conversion exists (are you missing a cast?).”
You need to ensure that the code can be compiled.
Which code should you use to replace line 05?
A. var2 = ((List) array1) [0];
B. var2 = array1[0].Equals(typeof(int));
C. var2 = Convert.ToInt32(array1[0]);
D. var2 = ((int[])array1)[0];


Answer Clike
HOTSPOT

HOTSPOT
You have the following code (line numbers are included for reference only):

To answer, complete each statement according to the information presented in the code.
Hot Area:



Answer Clike
What should you use?

You need to create a method that can be called by using a varying number of parameters.
What should you use?
A. Method overloading
B. Interface
C. Named parameters
D. Lambda expressions


Answer Clike
HOTSPOT

HOTSPOT
You have the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:



Answer Clike
How should you write the catch block?

DRAG DROP
You are creating a method that saves information to a database.
You have a static class named LogHelper. LogHelper has a method named Log to log the exception.
You need to use the LogHelper Log method to log the exception raised by the database server. The solution must ensure that the exception can be caught by the calling method, while preserving the original stack trace.
How should you write the catch block? (Develop the solution by selecting and ordering the required code snippets. You may not need all of the code snippets.)
Select and Place:



Answer Clike
HOTSPOT

HOTSPOT
You have the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:



Answer Clike
HOTSPOT

HOTSPOT
You are building a data access layer in an application that contains the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:



Answer Clike
Which code segment should you insert at line 04?

You are developing code for an application that retrieves information about Microsoft .NET Framework assemblies.
The following code segment is part of the application (line numbers are included for reference only):

You need to insert code at line 04. The code must load the assembly. Once the assembly is loaded, the code must be able to read the assembly metadata, but the code must be denied access from executing code from the assembly.
Which code segment should you insert at line 04?
A. Assembly.ReflectionOnlyLoadFrom(bytes);
B. Assembly.ReflectionOniyLoad(bytes);
C. Assembly.Load(bytes);
D. Assembly.LoadFrom(bytes);


Answer Clike
Which code segment should you insert at line 05?

You are developing a method named GenerateHash that will create the hash value for a file. The method includes the following code. (Line numbers are included for reference only.)

You need to return the cryptographic hash of the bytes contained in the fileBuffer variable.
Which code segment should you insert at line 05?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two interfaces should you implement?

You are modifying an existing application that manages employee payroll. The application includes a class named PayrollProcessor. The PayrollProcessor class connects to a payroll database and processes batches of paychecks once a week.
You need to ensure that the PayrollProcessor class supports iteration and releases database connections after the batch processing completes. Which two interfaces should you implement? (Each correct answer presents part of the complete solution. Choose two.)
A. IEquatable
B. IEnumerable
C. IDisposable
D. IComparable


Answer Clike
Which code segment should you use?

You are developing an application that will read data from a text file and display the file contents.
You need to read data from the file, display it, and correctly release the file resources.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which object type should you use?

You are developing an application that will parse a large amount of text.
You need to parse the text into separate lines and minimize memory use while processing data.
Which object type should you use?
A. DataContractSerializer
B. StringBuilder
C. StringReader
D. JsonSerializer


Answer Clike
Which code segment should you replace line 24?

You are developing an application that includes the following code segment. (Line numbers are included for reference only.)

You need to ensure that the DoWork(Widget widget) method runs.
With which code segment should you replace line 24?
A. DoWork((Widget)o);
B. DoWork(new Widget(o));
C. DoWork(o is Widget);
D. DoWork((ItemBase)o);


Answer Clike
Which code segment should you insert at line 06?

An application uses X509 certificates for data encryption and decryption. The application stores certificates in the Personal certificates collection of the Current User store. On each computer, each certificate subject is unique.
The application includes a method named LoadCertificate. The LoadCertificate() method includes the following code. (Line numbers are included for reference only.)

The LoadCertificate() method must load only certificates for which the subject exactly matches the searchValue parameter value.
You need to ensure that the LoadCertificate() method loads the correct certificates.
Which code segment should you insert at line 06?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you do?

You are developing a class named Scorecard. The following code implements the Scorecard class. (Line numbers are included for reference only.)

You create the following unit test method to test the Scorecard class implementation:

You need to ensure that the unit test will pass.
What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you do?

You are writing the following method (line numbers are included for reference only):

You need to ensure that CreateObject compiles successfully.
What should you do?
A. Insert the following code at line 02: here T : new()
B. Replace line 01 with the following code: public void CreateObject<T>()
C. Replace line 01 with the following code: public Object CreateObject<T>()
D. Insert the following code at line 02: where T : Object


Answer Clike
Which code segment should you use in the method body?

You are implementing a method named ProcessReports that performs a long-running task. The ProcessReports() method has the following method signature:
public void ProcessReports(List values,CancellationTokenSource cts, CancellationToken ct)
If the calling code requests cancellation, the method must perform the following actions:
Cancel the long-running task.
Set the task status to TaskStatus.Canceled.
You need to ensure that the ProcessReports() method performs the required actions.
Which code segment should you use in the method body?
A. if (ct.IsCancellationRequested) return;
B. ct.ThrowIfCancellationRequested() ;
C. cts.Cancel();
D. throw new AggregateException();


Answer Clike
Which two assembly identity attributes should you include in the source code?

You are developing an application that will be deployed to multiple computers. You set the assembly name.
You need to create a unique identity for the application assembly.
Which two assembly identity attributes should you include in the source code? (Each correct answer presents part of the solution. Choose two.)
A. AssemblyTitleAttribute
B. AssemblyCultureAttribute
C. AssemblyVersionAttribute
D. AssemblyKeyNameAttribute
E. AssemblyFileVersion


Answer Clike
Which type of delegate should you use?

You are developing an application.
You need to declare a delegate for a method that accepts an integer as a parameter, and then returns an integer.
Which type of delegate should you use?
A. Action
B. Action
C. Func
D. Func


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are adding a function to a membership tracking application. The function uses an integer named memberCode as an input parameter and returns the membership type as a string.
The function must meet the following requirements:
Return “Non-Member” if the memberCode is 0.
Return “Member” if the memberCode is 1.
Return “Invalid” if the memberCode is any value other than 0 or 1.
You need to implement the function to meet the requirements.
How should you complete the relevant code? (To answer, drag the appropriate statements to the correct locations in the answer area. Each statement 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.)
Select and Place:



Answer Clike
Which signature should you use for each method?

HOTSPOT
You are developing the following classes named:
Class1
Class2
Class3
All of the classes will be part of a single assembly named Assembly.dll. Assembly.dll will be used by multiple applications.
All of the classes will implement the following interface, which is also part ofAssembly.dll:
public interface Interface1
{
void Method1(decimal amount);
void Method2(decimal amount);
}
You need to ensure that the Method2 method for the Class3 class can be executed only when instances of the class are accessed through the Interface1 interface. The solution must ensure that calls to the Method1 method can be made either through the interface or through an instance of the class.
Which signature should you use for each method? (To answer, select the appropriate signature for each method in the answer area.)
Hot Area:



Answer Clike
Which code should you use?

You have the following code:

You need to retrieve all of the numbers from the items variable that are greater than 80.
Which code should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are creating a method that will split a single input file into two smaller output files.
The method must perform the following actions:
Create a file named header.dat that contains the first 20 bytes of the input file.
Create a file named body.dat that contains the remainder of the input file.
You need to create the method.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which type of object should you use in the method?

You need to write a method that retrieves data from a Microsoft Access 2013 database.
The method must meet the following requirements:
Be read-only.
Be able to use the data before the entire data set is retrieved.
Minimize the amount of system overhead and the amount of memory usage.
Which type of object should you use in the method?
A. SqlDataAdapter
B. DataContext
C. DbDataAdapter
D. OleDbDataReader


Answer Clike
Which code segment should you insert at line 03?

You are developing an application that uses several objects. The application includes the following code segment. (Line numbers are included for reference only.)

You need to evaluate whether an object is null.
Which code segment should you insert at line 03?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code should you use to replace line 05?

You are developing an application.
The application contains the following code segment (line numbers are included for reference only):

When you run the code, you receive the following error message: “Cannot implicitly convert type ‘object” to ‘int’. An explicit conversion exists (are you missing a cast?).”
You need to ensure that the code can be compiled.
Which code should you use to replace line 05?
A. var2 = arrayl[0] is int;
B. var2 = ((List)arrayl) [0];
C. var2 = arrayl[0].Equals(typeof(int));
D. var2 = (int) arrayl [0];


Answer Clike
How should you complete the relevant code?

HOTSPOT
You are developing an application that includes a Windows Communication Foundation (WCF) service. The service includes a custom TraceSource object named ts and a method named DoWork. The application must meet the following requirements:
Collect trace information when the DoWork() method executes.
Group all traces for a single execution of the DoWork() method as an activity that can be viewed in the WCF Service Trace Viewer Tool.
You need to ensure that the application meets the requirements.
How should you complete the relevant code? (To answer, select the correct code segment from each drop-down list in the answer area.)
Hot Area:



Answer Clike
How should you complete the relevant code segment?

DRAG DROP
You are developing a class named Temperature.
You need to ensure that collections of Temperature objects are sortable.
How should you complete the relevant code segment? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
How should you complete the relevant code?

DRAG DROP
You are developing an application that will populate an extensive XML tree from a Microsoft SQL Server 2008 R2 database table named Contacts.
You are creating the XML tree. The solution must meet the following requirements: Minimize memory requirements.
Maximize data processing speed.
You open the database connection. You need to create the XML tree.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
How should you complete the relevant code?

DRAG DROP
You are creating a class named Data that includes a dictionary object named _data.
You need to allow the garbage collection process to collect the references of the _data object.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which code should you insert at line 03?

You are creating a console application named App1.
App1 retrieves data from the Internet by using JavaScript Object Notation (JSON).
You are developing the following code segment (line numbers are included for reference only):

You need to ensure that the code validates the JSON string.
Which code should you insert at line 03?
A. DataContractSerializer serializer = new DataContractSerializer();
B. var serializer = new DataContractSerializer();
C. XmlSerlalizer serializer = new XmlSerlalizer();
D. var serializer = new JavaScriptSerializer();


Answer Clike
Which line of code should you identify?

You have the following code (line numbers are included for reference only):

You need to identify the missing line of code at line 15. Which line of code should you identify?
A. using (fooSqlConn.BeginTransaction())
B. while (fooSqlReader.Read())
C. while (fooSqlReader.NextResult())
D. while (fooSqlReader.GetBoolean(0))


Answer Clike
Which code should you insert at line 04?

HOTSPOT
You are developing an application in C#.
The application will display the temperature and the time at which the temperature was recorded. You have the following method (line numbers are included for reference only):

You need to ensure that the message displayed in the lblMessage object shows the time formatted according to the following requirements:
The time must be formatted as hour:minute AM/PM, for example 2:00 PM.
The date must be formatted as month/day/year, for example 04/21/2013.
The temperature must be formatted to have two decimal places, for example 23-45.
Which code should you insert at line 04? (To answer, select the appropriate options in the answer area.)
Hot Area:



Answer Clike
How should you rewrite lines 03 through 06 of the method?

You have a List object that is generated by executing the following code:

You have a method that contains the following code (line numbers are included for reference only):

You need to alter the method to use a lambda statement.
How should you rewrite lines 03 through 06 of the method?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which type of block should you use?

You are developing code for a class named Account. The Account class includes the following method:

You need to ensure that overflow exceptions are thrown when there is an error.
Which type of block should you use?
A. checked
B. try
C. using
D. unchecked


Answer Clike
What should you include in the application code?

You are developing an application that uses a .config file.
The relevant portion of the .config file is shown as follows:

You need to ensure that diagnostic data for the application writes to the event tog by using the configuration specified in the .config file.
What should you include in the application code?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which form should you implement the score member?

You are creating a class named Game.
The Game class must meet the following requirements:
Include a member that represents the score for a Game instance.
Allow external code to assign a value to the score member.
Restrict the range of values that can be assigned to the score member.
You need to implement the score member to meet the requirements.
In which form should you implement the score member?
A. protected field
B. public static field
C. public static property
D. public property


Answer Clike
HOTSPOT

HOTSPOT
You have the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:



Answer Clike
What should you do?

DRAG DROP
You have a method named GetCustomerIDs that returns a list of integers. Each entry in the list represents a customer ID that is retrieved from a list named Customers. The Customers list contains 1,000 rows.
Another developer creates a method named ValidateCustomer that accepts an integer parameter and returns a Boolean value. ValidateCustomer returns true if the integer provided references a valid customer. ValidateCustomer can take up to one second to run.
You need to create a method that returns a list of valid customer IDs. The code must execute in the shortest amount of time.
What should you do? (Develop the solution by selecting and ordering the required code snippets. You may not need all of the code snippets.)
Select and Place:



Answer Clike
What should you do?

DRAG DROP
You have the following class:

You need to implement IEquatable. The Equals method must return true if both ID and Name are set to the identical values. Otherwise, the method must return false. Equals must not throw an exception.
What should you do? (Develop the solution by selecting and ordering the required code snippets. You may not need all of the code snippets.)
Select and Place:



Answer Clike
HOTSPOT

HOTSPOT
You are reviewing the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:



Answer Clike
HOTSPOT

HOTSPOT
You have the following code:

To answer, complete each statement according to the information presented in the code.
Hot Area:



Answer Clike
Which code segment should you use?

You are developing a C# application that includes a class named Product. The following code segment defines the Product class:

You implement System.ComponentModel.DataAnnotations.IValidateableObject interface to provide a way to validate the Product object. The Product object has the following requirements:
The Id property must have a value greater than zero.
The Name property must have a value other than empty or null.
You need to validate the Product object. Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use?

You are developing an application. The application calls a method that returns an array of integers named customerIds. You define an integer variable named customerIdToRemove and assign a value to it. You declare an array named filteredCustomerIds.
You have the following requirements.
Remove duplicate integers from the customerIds array.
Sort the array in order from the highest value to the lowest value.
Remove the integer value stored in the customerIdToRemove variable from the customerIds array.
You need to create a LINQ query to meet the requirements.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
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?
A. DES
B. HMACSHA512
C. RNGCryptoServiceProvider
D. ECDsa


Answer Clike
Which three actions should you perform in sequence?

DRAG DROP
You are developing an application by using C#. The application will process several objects per second.
You need to create a performance counter to analyze the object processing.
Which three actions should you perform in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.)
Select and Place:



Answer Clike
Which code segment should you insert at line 08?

You are developing an application that uses the Microsoft ADO.NET Entity Framework to retrieve order information from a Microsoft SQL Server database. The application includes the following code. (Line numbers are included for reference only.)

The application must meet the following requirements:
Return only orders that have an OrderDate value other than null.
Return only orders that were placed in the year specified in the year parameter.
You need to ensure that the application meets the requirements. Which code segment should you insert at line 08?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use?

You are creating an application that manages information about your company’s products. The application includes a class named Product and a method named Save.
The Save() method must be strongly typed. It must allow only types inherited from the Product class that use a constructor that accepts no parameters.
You need to implement the Save() method.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two actions should you perform?

You are creating a class named Employee. The class exposes a string property named EmployeeType. The following code segment defines the Employee class. (Line numbers are included for reference only.)

The EmployeeType property value must meet the following requirements:
The value must be accessed only by code within the Employee class or within a class derived from the Employee class.
The value must be modified only by code within the Employee class.
You need to ensure that the implementation of the EmployeeType property meets the requirements.
Which two actions should you perform? (Each correct answer represents part of the complete solution. Choose two.)
A. Replace line 03 with the following code segment: public string EmployeeType
B. Replace line 06 with the following code segment: protected set;
C. Replace line 05 with the following code segment: private get;
D. Replace line 05 with the following code segment: protected get;
E. Replace line 03 with the following code segment: protected string EmployeeType
F. Replace line 06 with the following code segment: private set;


Answer Clike
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?
A. RemoveMemoryPressure()
B. ReRegisterForFinalize()
C. WaitForFullGCComplete()
D. KeepAlive()


Answer Clike
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?
A. RSA
B. Aes
C. HMACSHA256
D. DES


Answer Clike
What should you do?

You use the Task.Run() method to launch a long-running data processing operation. The data processing operation often fails in times of heavy network congestion.
If the data processing operation fails, a second operation must clean up any results of the first operation.
You need to ensure that the second operation is invoked only if the data processing operation throws an unhandled exception. What should you do?
A. Create a task within the operation, and set the Task.StartOnError property to true.
B. Create a TaskFactory object and call the ContinueWhenAll() method of the object.
C. Create a task by calling the Task.ContinueWith() method.
D. Use the TaskScheduler class to create a task and call the TryExecuteTask() method on the class.


Answer Clike
Which two assembly attributes should you include in the source code?

You are developing an application by using C#. You provide a public key to the development team during development.
You need to specify that the assembly is not fully signed when it is built.
Which two assembly attributes should you include in the source code? (Each correct answer presents part of the solution. Choose two.)
A. AssemblyFlagsAttribute
B. AssemblyKeyFileAttribute
C. AssemblyConfigurationAttribute
D. AssemblyDelaySignAttribute


Answer Clike
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?
A. RSA
B. HMACSHA2S6
C. Aes
D. RNGCryptoServiceProvider


Answer Clike
Which code segment should you use?

You are developing an application that uses structured exception handling. The application includes a class named Logger. The Logger class implements a method named Log by using the following code segment: public static void Log(Exception ex) { }
You have the following requirements:
Log all exceptions by using the Log() method of the Logger class.
Rethrow the original exception, including the entire exception stack.
You need to meet the requirements. Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are developing an application that will include a method named GetData. The GetData() method will retrieve several lines of data from a web service by using a System.IO.StreamReader object.
You have the following requirements:
The GetData() method must return a string value that contains the entire response from the web service.
The application must remain responsive while the GetData() method runs.
You need to implement the GetData() method.
How should you complete the relevant code? (To answer, drag the appropriate objects to the correct locations in the answer area. Each object 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.)
Select and Place:



Answer Clike
What should you do?

You are developing an application that includes a class named BookTracker for tracking library books. The application includes the following code segment. (Line numbers are included for reference only.)

You need to add a book to the BookTracker instance.
What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are developing an application that implements a set of custom exception types. You declare the custom exception types by using the following code segments:

The application includes a function named DoWork that throws .NET Framework exceptions and custom exceptions. The application contains only the following logging methods:

The application must meet the following requirements:
When ContosoValidationException exceptions are caught, log the information by using the static void Log (ContosoValidationException ex) method.
When ContosoDbException or other ContosoException exceptions are caught, log the information by using the static void Log(ContosoException ex) method.
You need to meet the requirements.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
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?
A. int result = (int)degreesRef;
B. int result = (int)(double)degreesRef;
C. int result = degreesRef;
D. int result = (int)(float)degreesRef;


Answer Clike
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?
A. WaitForFullGCComplete()
B. SuppressFinalize()
C. WaitForFullGCApproach()
D. WaitForPendingFinalizers()


Answer Clike
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.)
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”)]


Answer Clike
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?
A. CounterType = PerformanceCounterType.RawBase
B. CounterType = PerformanceCounterType.AverageBase
C. CounterType = PerformanceCounterType.SampleBase
D. CounterType = PerformanceCounterType.CounterMultiBase


Answer Clike
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?
A. ECDsa
B. RNGCryptoServiceProvider
C. Rfc2898DeriveBytes
D. HMACSHA512


Answer Clike
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?
A. WaitForFullGCComplete()
B. SuppressFinalize()
C. collect()
D. RemoveMemoryPressure()


Answer Clike
Which code segment should you use?

You are developing an application that will process orders. The debug and release versions of the application will display different logo images. You need to ensure that the correct image path is set based on the build configuration.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
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?
A. new XmlSerializer(typeof(Location))
B. new NetDataContractSerializer()
C. new DataContractJsonSerializer(typeof (Location))
D. new DataContractSerializer(typeof(Location))


Answer Clike
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?
A. LinkedList
B. Queue
C. Array
D. HashTable
E. SortedList


Answer Clike
Which code segment should you add at line 19?

You are developing an application that includes the following code segment. (Line numbers are included for reference only.)

You need to ensure that the application accepts only integer input and prompts the user each time non-integer input is entered. Which code segment should you add at line 19?
A. If (!int.TryParse(sLine, out number))
B. If ((number = Int32.Parse(sLine)) == Single.NaN)
C. If ((number = int.Parse(sLine)) > Int32.MaxValue)
D. If (Int32.TryParse(sLine, out number))


Answer Clike
What should you do?

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?
A. Insert the following code segment at tine 05: Debug.Write(loanAmount > 0);
B. Insert the following code segment at line 05: Trace.Write(loanAmount > 0);
C. Insert the following code segment at line 03: Debug.Assert(loanAmount > 0);
D. Insert the following code segment at line 03: Trace.Assert(loanAmount > 0);


Answer Clike
Which code segment should you insert at line 04?

An application will upload data by using HTML form-based encoding. The application uses a method named SendMessage. The SendMessage() method includes the following code. (Line numbers are included for reference only.)

The receiving URL accepts parameters as form-encoded values.
You need to send the values intA and intB as form-encoded values named a and b, respectively.
Which code segment should you insert at line 04?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you insert at line 10?

An application receives JSON data in the following format:

The application includes the following code segment. (Line numbers are included for reference only.)

You need to ensure that the ConvertToName() method returns the JSON input string as a Name object. Which code segment should you insert at line 10?
A. Return ser.Desenalize (json, typeof(Name));
B. Return ser.ConvertToType(json);
C. Return ser.Deserialize(json);
D. Return ser.ConvertToType (json, typeof (Name));


Answer Clike
Which two actions should you perform?

You are developing an application that includes the following code segment. (Line numbers are included for reference only.)

The GetCustomers() method must meet the following requirements: Connect to a Microsoft SQL Server database.
Populate Customer objects with data from the database.
Return an IEnumerable collection that contains the populated Customer objects.
You need to meet the requirements.
Which two actions should you perform? (Each correct answer presents part of the solution.
Choose two.)
A. Insert the following code segment at line 17: while (sqlDataReader.GetValues())
B. Insert the following code segment at line 14: sqlConnection.Open();
C. Insert the following code segment at line 14: sqlConnection.BeginTransaction();
D. Insert the following code segment at line 17: while (sqlDataReader.Read())
E. Insert the following code segment at line 17: while (sqlDataReader.NextResult())


Answer Clike
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 area. 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.)
Select and Place:



Answer Clike
Which two code segments can you use to achieve this goal?

You are developing an application. The application includes classes named Mammal and Animal and an interface named IAnimal.
The Mammal class must meet the following requirements:
It must either inherit from the Animal class or implement the IAnimal interface.
It must be inheritable by other classes in the application.
You need to ensure that the Mammal class meets the requirements.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are developing a class named ExtensionMethods.
You need to ensure that the ExtensionMethods class implements the IsEmail() extension method on string objects.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which code segment should you insert at line 07?

You are developing an application by using C#. The application includes the following code segment. (Line numbers are included for reference only.)

The DoWork() method must throw an InvalidCastException exception if the obj object is not of type IDataContainer when accessing the Data property. You need to meet the requirements.
Which code segment should you insert at line 07?
A. var dataContainer = (IDataContainer) obj;
B. var dataContainer = obj as IDataContainer;
C. var dataContainer = obj is IDataContainer;
D. dynamic dataContainer = obj;


Answer Clike
Which four code segments should you use in sequence?

DRAG DROP
You are developing an application by using C#. The application will output the text string “First Line” followed by the text string “Second Line”. You need to ensure that an empty line separates the text strings.
Which four code segments should you use in sequence? (To answer, move the appropriate code segments to the answer area and arrange them in the correct order.)
Select and Place:



Answer Clike
Which access modifier should you use for the GetData() method?

An application includes a class named Person. The Person class includes a method named GetData.
You need to ensure that the GetData() method can be used only by the Person class and not by any class derived from the Person class.
Which access modifier should you use for the GetData() method?
A. Public
B. Protected internal
C. Internal
D. Private
E. Protected


Answer Clike
Which code segment should you use?

You are creating an application that manages information about your company’s products. The application includes a class named Product and a method named Save.
The Save() method must be strongly typed. It must allow only types inherited from the Product class that use a constructor that accepts no parameters.
You need to implement the Save() method. Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are implementing a method that creates an instance of a class named User. The User class contains a public event named Renamed. The following code segment defines the Renamed event:
Public event EventHandler Renamed;
You need to create an event handler for the Renamed event by using a lambda expression.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which code segment should you use?

You are creating a console application by using C#.
You need to access the assembly found in the file named car.dll.
Which code segment should you use?
A. Assembly.Load();
B. Assembly.GetExecutingAssembly();
C. This.GetType();
D. Assembly.LoadFile(“car.dll”);


Answer Clike
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?
A. WaitForFullGCComplete()
B. WaitForFullGCApproach()
C. KeepAlive()
D. WaitForPendingFinalizers()


Answer Clike
What should you do?

You are adding a public method named UpdateGrade to a public class named ReportCard.
The code region that updates the grade field must meet the following requirements:
It must be accessed by only one thread at a time.
It must not be vulnerable to a deadlock situation.
You need to implement the UpdateGrade() method.
What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you do?

You are developing an application that includes a class named BookTracker for tracking library books. The application includes the following code segment. (Line numbers are included for reference only.)

You need to add a user to the BookTracker instance. What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use?

You are developing an application that accepts the input of dates from the user.
Users enter the date in their local format. The date entered by the user is stored in a string variable named inputDate. The valid date value must be placed in a DateTime variable named validatedDate.
You need to validate the entered date and convert it to Coordinated Universal Time (UTC). The code must not cause an exception to be thrown.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which three actions should you perform in sequence?

DRAG DROP
You are developing an application by using C#. The application will process several objects per second. You need to create a performance counter to analyze the object processing.
Which three actions should you perform in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.)
Select and Place:



Answer Clike
Which two assembly attributes should you include in the source code?

You are developing an application by using C#. You provide a public key to the development team during development.
You need to specify that the assembly is not fully signed when it is built.
Which two assembly attributes should you include in the source code? (Each correct answer presents part of the solution. Choose two.)
A. AssemblyKeyNameAttribute
B. ObfuscateAssemblyAttribute
C. AssemblyDelaySignAttribute
D. AssemblyKeyFileAttribute


Answer Clike
Which three code segments should you insert in sequence at line 09?

DRAG DROP
You are developing an application that includes a class named Warehouse. The Warehouse class includes a static property named Inventory- The Warehouse class is defined by the following code segment. (Line numbers are included for reference only.)

You have the following requirements:
Initialize the _inventory field to an Inventory instance. Initialize the _inventory field only once.
Ensure that the application code acquires a lock only when the _inventory object must be instantiated.
You need to meet the requirements.
Which three code segments should you insert in sequence at line 09? (To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.)
Select and Place:



Answer Clike
How should you complete the relevant code?

DRAG DROP
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.
You have the following requirements:
The CalculateInterest() method must run for all build configurations.
The LogLine() method must be called only for debug builds.
You need to ensure that the methods run correctly.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which two actions can you perform to achieve this goal?

You are developing an assembly that will be used by multiple applications.
You need to install the assembly in the Global Assembly Cache (GAC).
Which two actions can you perform to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Use the Assembly Registration tool (regasm.exe) to register the assembly and to copy the assembly to the GAC.
B. Use the Strong Name tool (sn.exe) to copy the assembly into the GAC.
C. Use Microsoft Register Server (regsvr32.exe) to add the assembly to the GAC.
D. Use the Global Assembly Cache tool (gacutil.exe) to add the assembly to the GAC.
E. Use Windows Installer 2.0 to add the assembly to the GAC.


Answer Clike
What should you do?

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

You need to ensure that the debugger breaks execution within the CalculateInterest() method when the loanAmount variable is less than or equal to zero in all builds of the application.
What should you do?
A. Insert the following code segment at line 03: Trace.Assert(loanAmount > 0);
B. Insert the following code segment at line 03: Debug.Assert(loanAmount > 0);
C. Insert the following code segment at line 05: Debug.Write(loanAmount > 0);
D. Insert the following code segment at line 05: Trace.Write(loanAmount > 0);


Answer Clike
Which two actions should you perform?

You are developing an application by using C#.
You have the following requirements:
Support 32-bit and 64-bit system configurations.
Include pre-processor directives that are specific to the system configuration.
Deploy an application version that includes both system configurations to testers.
Ensure that stack traces include accurate line numbers.
You need to configure the project to avoid changing individual configuration settings every time you deploy the application to testers.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Update the platform target and conditional compilation symbols for each application configuration.
B. Create two application configurations based on the default Release configuration.
C. Optimize the application through address rebasing in the 64-bit configuration.
D. Create two application configurations based on the default Debug configuration.


Answer Clike
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 Counter1 is available for use in Windows Performance Monitor (PerfMon).
Which code segment should you insert at line 16?
A. CounterType = PerformanccCounterType.RawBase
B. CounterType = PerformanceCounterType.AverageBase
C. CounterType = PerformanceCounterType.SampleBase
D. CounterType = PerformanceCounterType.CounterMultiBase


Answer Clike
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?
A. HMACSHA256
B. RNGCryptoServiceProvider
C. DES
D. Aes


Answer Clike
DRAG DROP

DRAG DROP
You are developing an application that implements a set of custom exception types. You declare the custom exception types by using the following code segments:

The application includes a function named DoWork that throws .NET Framework exceptions and custom exceptions.
The application contains only the following logging methods:

The application must meet the following requirements:
When AdventureWorksValidationException exceptions are caught, log the information by using the static void Log (AdventureWorksValidationException ex) method.
When AdventureWorksDbException or other AdventureWorksException exceptions are caught, log the information by using the static void I oq ( AdventureWorksException ex) method.
You need to meet the requirements.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which code segment should you insert at line 04?

You are developing a C# application that has a requirement to validate some string input data by using the Regex class.
The application includes a method named ContainsHyperlink. The ContainsHyperlink() method will verify the presence of a URI and surrounding markup.
The following code segment defines the ContainsHyperlink() method. (Line numbers are included for reference only.)

The expression patterns used for each validation function are constant.

You need to ensure that the expression syntax is evaluated only once when the Regex object is initially instantiated. Which code segment should you insert at line 04?
A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you do?

You are adding a public method named UpdateScore to a public class named ScoreCard.
The code region that updates the score field must meet the following requirements: It must be accessed by only one thread at a time.
It must not be vulnerable to a deadlock situation.
You need to implement the UpdateScore() method.
What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are developing an application that will include a method named GetData. The GetData() method will retrieve several lines of data from a web service by using a System.IO.StreamReader object.
You have the following requirements:
The GetData() method must return a string value that contains the first line of the response from the web service.
The application must remain responsive while the GetData() method runs.
You need to implement the GetData() method.
How should you complete the relevant code? (To answer, drag the appropriate objects to the correct locations in the answer area. Each object 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.)
Select and Place:



Answer Clike
Which three code segments should you insert in sequence at line 09?

DRAG DROP
You are developing an application that includes a class named Kiosk. The Kiosk class includes a static property named Catalog. The Kiosk class is defined by the following code segment. (Line numbers are included for reference only.)

You have the following requirements:
Initialize the _catalog field to a Catalog instance.
Initialize the _catalog field only once.
Ensure that the application code acquires a lock only when the _catalog object must be instantiated.
You need to meet the requirements.
Which three code segments should you insert in sequence at line 09? (To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.)
Select and Place:



Answer Clike
DRAG DROP

DRAG DROP
You develop an application that displays information from log files when errors occur. The application will prompt the user to create an error report that sends details about the error and the session to the administrator.
When a user opens a log file by using the application, the application throws an exception and closes.
The application must preserve the original stack trace information when an exception occurs during this process.
You need to implement the method that reads the log files.
You have the following code:

Which code segments should you include in Target 1 and Target 2 to complete the code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which code segment should you use?

You are developing an application that uses structured exception handling. The application includes a class named ExceptionLogger.
The ExceptionLogger class implements a method named LogException by using the following code segment:
public static void LogException(Exception ex)
You have the following requirements:
Log all exceptions by using the LogException() method of the ExceptionLogger class. Rethrow the original exception, including the entire exception stack.
You need to meet the requirements.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
What should you do?

You are developing an application that includes a class named UserTracker. The application includes the following code segment. (Line numbers are included for reference only.)

You need to add a user to the UserTracker instance.
What should you do?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two actions should you perform?

You are modifying an application that processes leases. The following code defines the Lease class. (Line numbers are included for reference only.)

Leases are restricted to a maximum term of 5 years. The application must send a notification message if a lease request exceeds 5 years. You need to implement the notification mechanism.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
F. Option F


Answer Clike
How should you complete the relevant code?

HOTSPOT
You are implementing a library method that accepts a character parameter and returns a string.
If the lookup succeeds, the method must return the corresponding string value. If the lookup fails, the method must return the value “invalid choice.”
You need to implement the lookup algorithm.
How should you complete the relevant code? (To answer, select the correct keyword in each drop-down list in the answer area.)
Hot Area:



Answer Clike
What should you do?

You use the Task.Run() method to launch a long-running data processing operation. The data processing operation often fails in times of heavy network congestion.
If the data processing operation fails, a second operation must clean up any results of the first operation.
You need to ensure that the second operation is invoked only if the data processing operation throws an unhandled exception.
What should you do?
A. Create a TaskCompletionSource<T> object and call the TrySetException() method of the object.
B. Create a task by calling the Task.ContinueWith() method.
C. Examine the Task.Status property immediately after the call to the Task.Run() method.
D. Create a task inside the existing Task.Run() method by using the AttachedToParent option.


Answer Clike
Which code segment should you use?

You are creating a console application by using C#.
You need to access the application assembly.
Which code segment should you use?
A. Assembly.GetAssembly(this);
B. this.GetType();
C. Assembly.Load();
D. Assembly.GetExecutingAssembly();


Answer Clike
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?
A. ReRegisterForFinalize()
B. SuppressFinalize()
C. Collect()
D. WaitForFullGCApproach()


Answer Clike
Which two actions should you perform?

You are creating a class named Employee. The class exposes a string property named EmployeeType. The following code segment defines the Employee class. (Line numbers are included for reference only.)

The EmployeeType property value must be accessed and modified only by code within the Employee class or within a class derived from the Employee class.
You need to ensure that the implementation of the EmployeeType property meets the requirements.
Which two actions should you perform? (Each correct answer represents part of the complete solution. Choose two.)
A. Replace line 05 with the following code segment: protected get;
B. Replace line 06 with the following code segment: private set;
C. Replace line 03 with the following code segment: public string EmployeeType
D. Replace line 05 with the following code segment: private get;
E. Replace line 03 with the following code segment: protected string EmployeeType
F. Replace line 06 with the following code segment: protected set;


Answer Clike
Which code segment should you insert at line 04?

You are implementing a method named Calculate 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?
A. int balance = (int) (float)amountRef;
B. int balance = (int)amountRef;
C. int balance = amountRef;
D. int balance = (int) (double) amountRef;


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are developing a class named ExtensionMethods.
You need to ensure that the ExtensionMethods class implements the IsEmail() method on string objects.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which two code segments can you use to achieve this goal?

You are developing an application. The application includes classes named Employee and Person and an interface named IPerson.
The Employee class must meet the following requirements:
It must either inherit from the Person class or implement the IPerson interface. It must be inheritable by other classes in the application.
You need to ensure that the Employee class meets the requirements.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you insert at line 06?

You are developing an application that will convert data into multiple output formats.
The application includes the following code. (Line numbers are included for reference only.)

You are developing a code segment that will produce tab-delimited output. All output routines implement the following interface:

You need to minimize the completion time of the GetOutput() method. Which code segment should you insert at line 06?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which code segment should you use?

You are creating an application that manages information about zoo animals. The application includes a class named Animal and a method named Save.
The Save() method must be strongly typed. It must allow only types inherited from the Animal class that uses a constructor that accepts no parameters. You need to implement the Save() method.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
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 a JSON object.
Which code segment should you insert at line 20?
A. New DataContractSerializer(typeof(Location))
B. New XmlSerializer(typeof(Location))
C. New NetDataContractSenalizer()
D. New DataContractJsonSerializer(typeof(Location))


Answer Clike
Which access modifier should you use for the GetData() method?

An application includes a class named Person. The Person class includes a method named GetData.
You need to ensure that the GetData() from the Person class.
Which access modifier should you use for the GetData() method?
A. Internal
B. Protected
C. Private
D. Protected internal
E. Public


Answer Clike
Which code segment should you insert at line 07?

You are developing an application by using C#. The application includes the following code segment. (Line numbers are included for reference only.)

The DoWork() method must not throw any exceptions when converting the obj object to the IDataContainer interface or when accessing the Data property.
You need to meet the requirements. Which code segment should you insert at line 07?
A. var dataContainer = (IDataContainer)obj;
B. dynamic dataContainer = obj;
C. var dataContainer = obj is IDataContainer;
D. var dataContainer = obj as IDataContainer;


Answer Clike
Which code segment should you insert at line 10?

An application receives JSON data in the following format:

The application includes the following code segment. (Line numbers are included for reference only.)

You need to ensure that the ConvertToName() method returns the JSON input string as a Name object.
Which code segment should you insert at line 10?
A. Return ser.ConvertToType(json);
B. Return ser.DeserializeObject(json);
C. Return ser.Deserialize(json);
D. Return (Name)ser.Serialize(json);


Answer Clike
How should you complete the relevant code?

DRAG DROP
An application serializes and deserializes XML from streams. The XML streams are in the following format:

The application reads the XML streams by using a DataContractSerializer object that is declared by the following code segment: var ser = new DataContractSerializer(typeof(Name));
You need to ensure that the application preserves the element ordering as provided in the XML stream.
How should you complete the relevant code? (To answer, drag the appropriate attributes to the correct locations in the answer area-Each attribute 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.)
Select and Place:



Answer Clike
Which code segment should you insert at line 08?

You are developing an application that uses the Microsoft ADO.NET Entity Framework to retrieve order information from a Microsoft SQL Server database. The application includes the following code. (Line numbers are included for reference only.)

The application must meet the following requirements:
Return only orders that have an OrderDate value other than null.
Return only orders that were placed in the year specified in the OrderDate property or in a later year.
You need to ensure that the application meets the requirements. Which code segment should you insert at line 08?
A. Where order.OrderDate.Value != null && order.OrderDate.Value.Year > = year
B. Where order.OrderDate.Value = = null && order.OrderDate.Value.Year = = year
C. Where order.OrderDate.HasValue && order.OrderDate.Value.Year = = year
D. Where order.OrderDate.Value.Year = = year


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are developing an application by using C#. The application includes an array of decimal values named loanAmounts. You are developing a LINQ query to return the values from the array.
The query must return decimal values that are evenly divisible by two. The values must be sorted from the lowest value to the highest value.
You need to ensure that the query correctly returns the decimal values.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:



Answer Clike
Which code segment should you use?

You are developing an application. The application includes a method named ReadFile that reads data from a file.
The ReadFile() method must meet the following requirements:
It must not make changes to the data file.
It must allow other processes to access the data file.
It must not throw an exception if the application attempts to open a data file that does not exist.
You need to implement the ReadFile() method. Which code segment should you use?
A. var fs = File.Open(Filename, FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite);
B. var fs = File.Open(Filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
C. var fs = File.Open(Filename, FileMode.OpenOrCreate, FileAccess.Read, FileShare.Write);
D. var fs = File.ReadAllLines(Filename);
E. var fs = File.ReadAllBytes(Filename);


Answer Clike
Which code segment should you use?

You are developing an application. The application calls a method that returns an array of integers named employeeIds. You define an integer variable named employeeIdToRemove and assign a value to it. You declare an array named filteredEmployeeIds.
You have the following requirements:
Remove duplicate integers from the employeeIds array.
Sort the array in order from the highest value to the lowest value.
Remove the integer value stored in the employeeIdToRemove variable from the employeeIds array.
You need to create a LINQ query to meet the requirements.
Which code segment should you use?

A. Option A
B. Option B
C. Option C
D. Option D


Answer Clike
Which two actions should you perform?

You are developing an application that includes the following code segment. (Line numbers are included for reference only.)

The GetAnimals() method must meet the following requirements: Connect to a Microsoft SQL Server database.
Create Animal objects and populate them with data from the database. Return a sequence of populated Animal objects.
You need to meet the requirements.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Insert the following code segment at line 16: while(sqlDataReader.NextResult())
B. Insert the following code segment at line 13: sqlConnection.Open();
C. Insert the following code segment at line 13: sqlConnection.BeginTransaction();
D. Insert the following code segment at line 16: while(sqlDataReader.Read())
E. Insert the following code segment at line 16: while(sqlDataReader.GetValues())


Answer Clike
How should you complete the relevant code?

DRAG DROP
You are developing a custom collection named LoanCollection for a class named Loan class.
You need to ensure that you can process each Loan object in the LoanCollection collection by using a foreach loop.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct locations in the answer area. 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.)
Select and Place:

ww ations


Answer Clike
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:
Use strongly typed members.
Process Order objects in first-in-first-out order.
Store values for each Order object.
Use zero-based indices.
You need to use a collection type that meets the requirements.
Which collection type should you use?
A. Queue<T>
B. SortedList
C. LinkedList<T>
D. HashTable
E. Array<T>


Answer Clike