diff --git a/SynonymsAPI/Services/BadService.cs b/SynonymsAPI/Services/BadService.cs index c68c883..2c25653 100644 --- a/SynonymsAPI/Services/BadService.cs +++ b/SynonymsAPI/Services/BadService.cs @@ -466,7 +466,7 @@ public bool Add_Test_123(string word) } } - else if (word == "C") + else if (word == "A") { if (word == "BA") { @@ -479,12 +479,54 @@ public bool Add_Test_123(string word) } return true; } + catch (Exception) { return false; } } + public decimal Calculate(decimal amount, int type, int years, bool foo1, bool foo2, bool foo3) + { + decimal result = 0; + decimal disc = (years > 5) ? (decimal)5 / 100 : (decimal)years / 100; + if (type == 1) + { + result = amount; + if (type == 1) + { + result = amount; + } + else if (type == 2) + { + result = (amount - (0.1m * amount)) - disc * (amount - (0.1m * amount)); + } + else if (type == 3) + { + result = (0.7m * amount) - disc * (0.7m * amount); + } + else if (type == 4) + { + result = (amount - (0.5m * amount)) - disc * (amount - (0.5m * amount)); + } + return result; + } + else if (type == 2) + { + result = (amount - (0.1m * amount)) - disc * (amount - (0.1m * amount)); + } + else if (type == 3) + { + result = (0.7m * amount) - disc * (0.7m * amount); + } + else if (type == 4) + { + result = (amount - (0.5m * amount)) - disc * (amount - (0.5m * amount)); + } + return result; + } + + @CodeScene(disable:\"Complex Method\") public decimal Calculate(decimal amount, int type, int years) { decimal result = 0;