exam questions

Exam 98-361 All Questions

View all questions & answers for the 98-361 exam

Exam 98-361 topic 1 question 81 discussion

Actual exam question from Microsoft's 98-361
Question #: 81
Topic #: 1
[All 98-361 Questions]

DRAG DROP -
You are developing an application that displays a list of race results. The race results are stored in the following class:

You need to implement the Add Race method.
Match the code segment to its location. (To answer, drag the appropriate code segment from the column on the left to its location on the right, Each code segment may be used once, more than once, or not at all. Each correct match is worth one point.)
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

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
Equinox
9 months, 2 weeks ago
Waht's the Fibonacci sequence doing in here? Tut tut.
upvoted 1 times
...
RobbyKrlos
2 years, 1 month ago
Thank you for the interest in this one - quite a headake it gave me. And I totally agree with you, the problem is simply bs. Without a given initializaiton, the AddRace will fail. It is not known how the Double linked list is given (which is the Head - The slowest or the fastest) as ccoutinho mentioned because of the " > time " it makes more sense to have the slowest in the Head of the linked list and therefore current.Faster has more sense. Even so, if the right spot is found in between 2 races for our new Race, the options to set the Race.Faster and Race.Slower are not correct. If the current position is on the "Faster" race in the list, it means that the new Race has to have Race.Faster = current AND Race.Slower = current.slower. Evidently just "current" is not an option. I'm puzzled how come this problem came as an exam point - I really hope it's somehting really really smart that we do not understand, 'cause otherwise it's just stupid:)
upvoted 2 times
...
ccoutinho
2 years, 3 months ago
I don't think this code is correct, besides being wrong, as stated by ReDo, it is oversimplistic. A possible implementation would be the following, I believe: public void AddRace(string raceName, double time) { var current = CurrentOlympicRecord; var previous = CurrentOlympicRecord != null ? CurrentOlympicRecord.Slower : null; while ( current != null && current.Time > time ) { previous = current; current = current.Faster; } var race = new RaceSpeedRecord { Race = raceName, Time = time, Faster = current, Slower = previous }; if (CurrentOlympicRecord == null) CurrentOlympicRecord = race; else { if (previous != null) previous.Faster = race; if (current != null) current.Slower = race; } }
upvoted 2 times
...
ReDo
2 years, 3 months ago
Why is the second match Current.Slower?
upvoted 4 times
ccoutinho
2 years, 3 months ago
Makes no sense to me! If we are iterating the list until we find a smaller running time than the given parameter, we are thus going from the longest running races until the smallest running races. That means we are iterating through faster records each time we proceed in the array, thus it should be Current.Faster.
upvoted 2 times
...
AishwaryaGupta
1 year, 2 months ago
Just think like this : if your speed is slow then you will take more time to complete
upvoted 1 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 ...