using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Currency
{
class Program
{
static void Main(string[] args)
{
// Declare Source and Target Currency.
string SCurrency, TCurrency;
//Declare and intialising a String currency array and a Double rate array.
String[] currency = new String[] {"Euro","Rupees","Dirhams"};
double[] rateAR =new double[] {0.73,62.68,3.67};
double TAmount,SAmount,Rate;
//Printing the TITLE and setting font color.
Console.Title = "Currency Application";
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("********CURRENCY CONVERTOR*********");
//Getting the Source and Target Currency.
Console.WriteLine("Enter the source currency in Dollars: ");
SCurrency = System.Console.ReadLine();
Console.WriteLine("Enter the target currency : ");
TCurrency = System.Console.ReadLine();
Console.WriteLine("Enter the amount to convert : ");
SAmount = System.Console.ReadLine(); ------------ > ERROR
for(int i=0;i<3;i++)
{
if (TCurrency == currency[i])
{
rateAR[i]=Rate;
}
}
TAmount = SAmount * Rate;
String StringAmount = Convert.ToString(TAmount);
System.Console.WriteLine("Converted Amount : " + StringAmount + ".");
Console.BackgroundColor = ConsoleColor.Black;
Console.ReadLine();
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Currency
{
class Program
{
static void Main(string[] args)
{
// Declare Source and Target Currency.
string SCurrency, TCurrency;
//Declare and intialising a String currency array and a Double rate array.
String[] currency = new String[] {"Euro","Rupees","Dirhams"};
double[] rateAR =new double[] {0.73,62.68,3.67};
double TAmount,SAmount,Rate;
//Printing the TITLE and setting font color.
Console.Title = "Currency Application";
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("********CURRENCY CONVERTOR*********");
//Getting the Source and Target Currency.
Console.WriteLine("Enter the source currency in Dollars: ");
SCurrency = System.Console.ReadLine();
Console.WriteLine("Enter the target currency : ");
TCurrency = System.Console.ReadLine();
Console.WriteLine("Enter the amount to convert : ");
SAmount = System.Console.ReadLine(); ------------ > ERROR
for(int i=0;i<3;i++)
{
if (TCurrency == currency[i])
{
rateAR[i]=Rate;
}
}
TAmount = SAmount * Rate;
String StringAmount = Convert.ToString(TAmount);
System.Console.WriteLine("Converted Amount : " + StringAmount + ".");
Console.BackgroundColor = ConsoleColor.Black;
Console.ReadLine();