+ 1
How to exeit to the loop ????
int pay = Convert.ToInt32(Console.ReadLine()); Payment pay1 = new Payment(); pay1.PaymentValue = pay; } } class Payment { private int paymentValue; //завершите свойство public int PaymentValue { get {return PaymentValue;} set { if (value < 50000) Console.WriteLine("Assepted"); else Console.WriteLine("Error"); PaymentValue = value;
2 Respostas
+ 1
Where is the loop ?
The code look valid.
Just one } missing at the end of the set-method
in the get method you need to use the private variable with lowercase letters.
The same in the set method.
Also notice that although you write an error. You are still assigning the value in the set method
0
Please, help me)))