Write a function-oriented program to convert the input dollar(s) into its equivalent peso. Assume that one dollar is equivalent to 53.80 pesos.
using System;
namespace Test
{
class ExchangeTest
{
static void Main()
{
Console.Write("Enter the value in dollars: ");
string tmp = Console.ReadLine();
float dollars;
if(!float.TryParse(tmp, out dollars))
{
Console.WriteLine("Bad input");
}
else
{
Console.WriteLine("The value in pesos: {0:0.00}", dollars * 53.80);
}
}
}
}
Comments
Leave a comment