هذا كلاس بسيط يؤدي المهمة :
public class MoneyConverter
{
double egp_param = 1.0;
double usd_param = 0.0561116;
public void Main()
{
Console.WriteLine(this.ConvertToEgp(1).ToString());
Console.WriteLine(this.ConvertToUsd(20).ToString());
}
public double ConvertToEgp(double usd)
{
return usd * (1 / usd_param);
}
public double ConvertToUsd(double egp)
{
return egp * usd_param;
}
}