Question: 1.To parse a string that might contain a currency value such as $1,234.56, you should pass the Parse or TryParse method which of the following

1.To parse a string that might contain a currency value such as $1,234.56, you should pass the Parse or TryParse method which of the following values?
a.NumberStyles.AllowCurrencySymbol
b.NumberStyles.AllowThousands
c.NumberStyles.Currency
d.A combination of all NumberStyles values
2.Which of the following statements is true for widening conversions?
a.Any value in the source type can fit into the destination type.
b.The conversion will not result in loss of magnitude but may result is some loss of precision.
c.An explicit cast is optional.
d.All of the above.
3.Which of the following statements is true for narrowing conversions?
a.The conversion will not result in loss of magnitude but may result is some loss of precision.
b.The source and destination types must be compatible.
c.An explicit cast is optional.
d.A cast can convert a string into an int if the string holds numeric text.
4.Assuming total is a decimal variable holding the value 1234.56, which of the following statements displays total with the currency format $1,234.56?
a.Console.WriteLine(total.ToString());
b.Console.WriteLine(total.ToCurrencyString());
c.Console.WriteLine(total.ToString("c"));
d.Console.WriteLine(Format("{0:C}", total);
5.Which of the following statements generates a string containing the text "Veni, vidi, vici"?
a.String.Format("{0}, {1}, {2}", Veni, vidi, vici)
b.String.Format("{1}, {2}, {3}", "Veni", "vidi", "vici")
c.String.Format("{2}, {0}, {3}", "vidi", "Venti", "Veni", "vici")
d.String.Format("{Veni, vidi, vici}")
6.If i is an int and l is a long, which of the following statements is true?
a.i = (int)l is a narrowing conversion.
b.l = (long)i is a narrowing conversion.
c.l = (long)i could cause an integer overflow.
d.The correct way to copy i's value into l is l = long.Parse(1).

Step by Step Solution

3.28 Rating (172 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1To parse a string that might contain a currency value such as 123456 you should pass the Parse or T... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

1013-C-S-O-S (700).docx

120 KBs Word File

Students Have Also Explored These Related Operating System Questions!