Which code should you insert at line 04?

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:

microsoft-exams

5 thoughts on “Which code should you insert at line 04?

  1. {0:t}

    {0:dd/mm/yyyy} : {0:d} will also work if the month is of two digits but if it is a single digit then as per the requirement it will not prefix 0 in front of the month. i.e. in order to display it as 04/21/2013, {0:dd/mm/yyyy} fits the requirement

    {1:N2}

    1. No, The right answer is 0:t, 0:d, 1:N2. Check in code

      1:mm/dd/yy – is for temperature, while 1 is the index of second element.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.