1.To parse a string that might contain a currency value such as $1,234.56, you should pass the...
Question:
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).
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: