+ 1

Hi, this is related to method parameters

class Program { static void Main(string[] args) { int totalPrice = Convert.ToInt32(Console.ReadLine()); //call the method Console.WriteLine(Discount(totalPrice)); } //complete the method declaration static int Discount(int totalPrice) { //complete the method body if (totalPrice > 10000) { double Sale = totalPrice - (0.2 * totalPrice); return Convert.ToInt32(Sale); } else { return totalPrice; } } } } I tried the above one but still its failing, can someone help?? When i tried this code in IDE, I am able to execute this without any errors but when I try in sololearn portal it fails...

22nd Nov 2022, 4:40 AM
Farhath Aamir
Farhath Aamir - avatar
1 Answer
+ 2
One bracket } at the end of code too many.
22nd Nov 2022, 3:50 PM
JaScript
JaScript - avatar