HOTSPOT
You are developing an application in C#.
The application will display the temperature and the time at which the temperature was recorded. You have the
following method (line numbers are included for reference only):
You need to ensure that the message displayed in the lblMessage object shows the time formatted according to
the following requirements:
The time must be formatted as hour:minute AM/PM, for example 2:00 PM.
The date must be formatted as month/day/year, for example 04/21/2013.
The temperature must be formatted to have two decimal places, for example 23-45.
Which code should you insert at line 04? (To answer, select the appropriate options in the answer area.)
Hot Area:

1 2 4
0
9
1 1 4
23
0
1 1 4
6
0
1 1 4
5
0
But d is short date pattern same as M/d/yyyy
So it is rendered as 4/21/2013 and not as 04/21/2013
The correct format string is {0:MM/dd/yyyy} which is not there in the dropdown.
Accounting for typo, the closest answer is
1 3 4
2
2
Agree
0
0
Answer 1 1 4 is correct if use en-US culture.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(“en-US”);
{0:t} and {0:d} are culture specific.
7
0
I think month/day/year order requirement in question is more important then 0 in example.
0
0
134 is wrong.
m means minutes, and M means month. There is lower case m.
114 is correct
0
0
Same as http://vceguide.com/which-code-should-you-insert-at-line-04/
Correct answer is 1 1 4
0
0
See also the docs to learn more:
https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
https://docs.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting
1
0
string output = string.Format(“time: {0:t}, date: {1:dd/MM/yyyy}, temp: {2:N2}”, time,time, temperature);
output : time: 16:55, date: 30/04/2018, temp: 12,25
* none of the first drpdown options shows the ‘PM’
* none of the second dropdwn is true.
1
0
Here it is important to understand that mm = minutes and MM = month. This makes the option 0:dd/mm/yyyy completely incorrect. The correct answer is 114.
0
0