static void Main(string[] args) { Console.WriteLine("We will convert BDT 1000 to other languages"); CurrencyContext bdtCurrency = new CurrencyContext(1000); CurrencyExpression bdConvert = new BDTConverter(); bdConvert.interpret(bdtCurrency, "usd"); Console.WriteLine("After conversion "+bdtCurrency.Output.ToString()); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("We will convert BDT 1000 to other languages"); CurrencyContext bdtCurrency = new CurrencyContext(1000); CurrencyExpression bdConvert = new BDTConverter(); bdConvert.interpret(bdtCurrency, "usd"); Console.WriteLine("After conversion " + bdtCurrency.Output.ToString()); Console.ReadLine(); }
public void interpret(CurrencyContext acontext, string type) { if (type == "usd") { acontext.Output = usd(acontext.Input); } else if (type == "bdt") { acontext.Output = bdt(acontext.Input); } else if (type == "gbp") { acontext.Output = gbp(acontext.Input); } else if (type == "myr") { acontext.Output = myr(acontext.Input); } }
public void interpret(CurrencyContext acontext, string type) { if (type == "usd") { acontext.Output=usd(acontext.Input); } else if (type == "bdt") { acontext.Output = bdt(acontext.Input); } else if (type == "gbp") { acontext.Output=gbp(acontext.Input); } else if (type == "myr") { acontext.Output=myr(acontext.Input); } }