exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 45 discussion

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

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:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1:

First we create the variable.
Box 2:

We create the first text line.
Box 3:

We add a blank line.
The StringBuilder.AppendLine method appends the default line terminator to the end of the current StringBuilder object.
Box 4:

Finally we add the second line.

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
oleg
Highly Voted 5 years, 10 months ago
Does the solution provided meets the "you need to ensure that an empty line separates the text strings" requirement? It seems to me "sb.AppendLine();" needs to be used twice to do so.
upvoted 6 times
Igris
5 years, 5 months ago
"empty line separates the text strings" we have 2 strings, 1 empty line, i dont see a problem
upvoted 9 times
...
WTH
5 years, 1 month ago
Agreed. sb.Append() doesn't create a separate line, while sb.AppendLine() does.
upvoted 2 times
...
Mona30
4 years, 9 months ago
depends if it needs to look like first line second line or first line second line
upvoted 2 times
Kilsimon
4 years, 8 months ago
I can see your point, but I would guess that there still is an "empty line separating the two strings". The empty line is just not on a line by itself but share the same line as "First Line".
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 ...