namespace CurrencyConverter.Programs
{
public static class ConvertionFee
{
public const decimal DollarFee = 5.53m;
public const decimal EuroFee = 6.41m;
public const decimal PoundFee = 7.37m;
public const decimal YenFee = 0.036m;
public const decimal StandardFee = 0.10m;
public const decimal SilverFee = 0.08m;
public const decimal GoldFee = 0.06m;
public const decimal PremiumFee = 0.04m;
}
public class ConvertionCalculation
{
decimal value;
decimal exchangeFee;
decimal categoryFee;
decimal newValue;
string symbol;
string category;
ConverterView viewConverter = new();
public void Play()
{
viewConverter.ShowWelcomeMenu();
while (true)
{
viewConverter.ShowMainMenu();
int choose = viewConverter.GetPlayerChoose(6);
switch (choose)
{
case 1:
while (true)
{
viewConverter.ShowCurrencyMenu();
choose = viewConverter.GetPlayerChoose(5);
switch (choose)
{
case 1: exchangeFee = ConvertionFee.DollarFee; symbol = "US$"; break;
case 2: exchangeFee = ConvertionFee.EuroFee; symbol = "€"; break;
case 3: exchangeFee = ConvertionFee.PoundFee; symbol = "£"; break;
case 4: exchangeFee = ConvertionFee.YenFee; symbol = "¥"; break;
case 5: break;
}
break;
}
break;
case 2:
while (true)
{
viewConverter.ShowCategoryMenu();
choose = viewConverter.GetPlayerChoose(5);
switch (choose)
{
case 1: categoryFee = ConvertionFee.StandardFee; category = "Standard"; break;
case 2: categoryFee = ConvertionFee.SilverFee; category = "Silver"; break;
case 3: categoryFee = ConvertionFee.GoldFee; category = "Gold"; break;
case 4: categoryFee = ConvertionFee.PremiumFee; category = "Premium"; break;
case 5: break;
}
break;
}
break;
case 3:
value = viewConverter.ShowEnterMenu();
break;
case 4:
Console.WriteLine($"\nAmount request for Conversion: R${value}.");
Console.WriteLine($"exchange fee of the chosen currency: {symbol}{exchangeFee}.");
Console.WriteLine($"Conversion fee of the chosen client category: {category} Fee: {categoryFee}.");
break;
case 5:
newValue = (value - (value * categoryFee))/exchangeFee;
Console.WriteLine($"\nYour amount after exchange is {symbol}{newValue:F2}.");
break;
case 6:
Console.WriteLine("Thank you, see you next time!");
return;
}
}
}
}
}