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.)

date formatting should be {0:mm/dd/yy}, but that option is not shown in the list.
0
1
Don’t forget that DateTime format also includes time not only date. Should be something like that:
var output = string.Format(“Temperature at {0:hh:mm} on {0:dd/mm/yy} is {1:N2}”, date, temp);
0
1
For me should be:
0:hh:mm tt
0:MM/dd/yyyy
1:N2
https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx
0
0
This is the write format. There is no write answer in the choices.
0
0
Same Question with answer is provided in below link
http://www.aiotestking.com/microsoft/which-code-should-you-insert-at-line-04/
0
0
there is no correct answer, should be:
output = string.Format(“Temperature at {0:hh:mm tt} on {0:MM/dd/yyyy}, temp: {1:N2}”, date, temp);
1
0
Temperature at {0:t} on {0:d} : {1:N2}
4
1
this is the correct answer. Refer to this thread: http://www.aiotestking.com/microsoft/which-code-should-you-insert-at-line-04/
1
0
agree with you dude
1
0
Based on testing, {0:d} is the best choice for formatting the the date.
0
1
Temperature at 21-03-2017 12:39:19 on 12:39 21-03-2017 – {0} on {0:t} {0:d}
Temperature at 23,453 on 12:39 21-39-17 – {1} on {0:hh:mm} {0:dd/mm/yy}
Temperature at 23,45 on 12:39 03-21-17 – {1:N2} on {0:hh:mm} {0:MM/dd/yy}
0
0
{0:t} displays argument 0 with short times(2:15pm)
{0:d} displayed argument 0 with short date(3/14/2017)
{1:N2} displays argument 1 with 2 decimal
Jiping Wang says:
May 10, 2016 at 10:14 am
{0:t}
{0:d}
{1:N2}
confirmed in Visual Studio:
string.Format(“time={0:t} date={0:d} temp={1:N2}”, DateTime.Now, 2)
——————————————
time=01:24 AM date=05/10/2016 temp=2.00
1
1
but first we need to choose the correct culture.
0
0