+ 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!
2 odpowiedzi
0
Just change the if statement to:
if ( value > 50000 ){...}
or
paymentValue = value;
if (paymentValue > 50000){...}
0
public int PaymentValue
{
get {return paymentValue; }
set
{
if (value > 50000){
Console.WriteLine("Error");
} else{
paymentValue = value;
Console.WriteLine("Accepted");
}
}
}