exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 4 discussion

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

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:

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
lephudien
Highly Voted 4 years, 10 months ago
The correct value is 3, 4, 6. The cursor (position) has been changed to fsSource only. I don't see why the offset in fsBody is other than 0.
upvoted 7 times
...
HgstExam
Most Recent 4 years, 9 months ago
Answer is correct. It Reads and moves the Position and Writes according to the length specified.
upvoted 4 times
noussa
4 years, 5 months ago
Yap, indeed I agree too
upvoted 1 times
...
...
Bart_v_M
4 years, 10 months ago
I think it should not be 3, 4 and 7. In my test this code gives an error. If I choose 3, 4, 6 there are no errors and the desired result is given.
upvoted 2 times
noussa
4 years, 5 months ago
yes, so the given answer is correct. 3,4,6
upvoted 1 times
...
...
stilldark
4 years, 11 months ago
Why no last option? We should take a file without header information because "that contains the remainder of the input file." so we should take from 20 byte to end?
upvoted 1 times
noussa
4 years, 5 months ago
Given answer is correct. Because you declared that the body is the length of the source -20, that's the first thing. Second, you need to keep in mind that the body has to be written in a different file so u can't start writing on a new file from index 20 it doesn't make any sense. The trick here is to play with the length of the header and the body
upvoted 3 times
...
...
thiemamd
4 years, 11 months ago
3, 4 and 7
upvoted 1 times
...
mohmou
4 years, 11 months ago
2, 4, 7 because fsbody begin read the file from 0 so it should be 2 not 3 because the 20 last bytes will be lost.
upvoted 2 times
dawcio12
4 years, 11 months ago
The answer is correct see remarks section of documentation: https://docs.microsoft.com/en-us/dotnet/api/system.io.filestream.read?view=netcore-3.1
upvoted 5 times
mohmou
4 years, 11 months ago
tested u r right
upvoted 2 times
...
...
...
johanpoelaert
4 years, 11 months ago
It should be 3, 4, 7
upvoted 2 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 ...