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?

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



Leave a Reply 6

Your email address will not be published. Required fields are marked *


PaulC

PaulC

C is correct.

keyword Distinct avoids duplicates and OrderByDescending provides the proper ordering from highest to lowest.

ASV

ASV

2 and 76 are the same.

Google

Google

Please take a look at the web-sites we follow, which includes this 1, because it represents our picks from the web.

Dip

Dip

Answer is C because of following reasons:
1. Values should be distinct
2. Values should be sorted in descending order.
3. Values present in EmployeeIDToRemove arrays should be removed.