An application includes two methods ConvertMoney and TransferMoney.We need to ensure that the precision and range of the value in the amount variable is not lost when the TransferMoney() method is called. Which code we should use? A.private static void ConvertMoney(float amoount) { TransferMoney((double)amount) } private statisc void TransferMoney(double amount) { Console.WriteLine(amount) } B.private static void ConvertMoney(float amoount) { TransferMoney((decimal)amount) } private statisc void TransferMoney(decimal amount) { Console.WriteLine(amount) } C.private static void ConvertMoney(float amoount) { TransferMoney(amount) } private statisc void TransferMoney(int amount) { Console.WriteLine(amount) } D.private static void ConvertMoney(float amoount) { TransferMoney((int)amount) } private statisc void TransferMoney(float amount) { Console.WriteLine(amount) }
Back to QuestionsOption A
Option B
Option C
Option D
The double type keyword stores 64-bit floating-point values. <br/> The float type keyword stores 32-bit floating-point values.
Answers Posted
PostedBy By: Abdul Samad Qureshi, at 02:43 PM on 27-March-2019
Answer Posted: A
Explanation: Float is smaller than double and decimal
Result: Correct