+ 2

why won't it catch else statement :((

https://code.sololearn.com/c0GHUQSxrtlx/?ref=app I'm so confused pls help Edit: Thank you everyone!

27th Oct 2020, 11:51 AM
Shuarma
Shuarma - avatar
2 Réponses
0
Just change the if statement to: if ( value > 50000 ){...} or paymentValue = value; if (paymentValue > 50000){...}
27th Oct 2020, 12:05 PM
QTWizard
0
public int PaymentValue { get {return paymentValue; } set { if (value > 50000){ Console.WriteLine("Error"); } else{ paymentValue = value; Console.WriteLine("Accepted"); } } }
27th Oct 2020, 12:49 PM
Jayakrishna 🇮🇳