exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 6 discussion

Actual exam question from Microsoft's 70-483
Question #: 6
Topic #: 1
[All 70-483 Questions]

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:

Show Suggested Answer Hide Answer
Suggested Answer:
Note: In a query expression, the orderby clause causes the returned sequence or subsequence (group) to be sorted in either ascending or descending order.
Examples:
// Query for ascending sort.
IEnumerable<string> sortAscendingQuery =
from fruit in fruits
orderby fruit //"ascending" is default
select fruit;
// Query for descending sort.
IEnumerable<string> sortDescendingQuery =
from w in fruits
orderby w descending
select w;

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
apostolin
Highly Voted 5 years, 9 months ago
The correct answer is : from amount in loanAmounts where amount % 2 == 0 orderby amount ascending select amount
upvoted 11 times
...
zzMichielzz
Most Recent 4 years, 8 months ago
from, where, orderby ascending, select
upvoted 2 times
...
cshine
4 years, 9 months ago
Answer: from amount in loanAmounts where amount % 2 ==0 orderby amount ascending select amount
upvoted 2 times
...
Tumelo_M_Motloutsi
4 years, 10 months ago
from amount in loanAmouts where amount % 2 == 0 orderby amount ascending select amount
upvoted 2 times
...
lh2607
4 years, 11 months ago
As the other two have said..
upvoted 2 times
...
robinnirola
5 years, 1 month ago
from where orderby ascending select
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...