50 lines
899 B
C#
50 lines
899 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Payment_prototype
|
|
{
|
|
class Platnosc
|
|
{
|
|
public Platnosc(float toPay, float balance)
|
|
{
|
|
this.stanKonta = balance;
|
|
this.doZaplaty = toPay;
|
|
}
|
|
public float doZaplaty { get; set; }
|
|
public float stanKonta { get; set; }
|
|
|
|
|
|
public Boolean checkAcc()
|
|
{
|
|
if(doZaplaty > stanKonta)
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public float payment()
|
|
{
|
|
if (checkAcc())
|
|
{
|
|
return stanKonta - doZaplaty;
|
|
}
|
|
else
|
|
{
|
|
return doZaplaty;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|