Merge remote-tracking branch 'origin/master'

This commit is contained in:
HeshamTB 2019-02-13 09:18:38 +03:00
commit 1139b17d66

View File

@ -1,34 +1,34 @@
package lab.three.one;
public class Account
{
private double balance;
public Account( double initialBalance )
{
if ( initialBalance > 0.0 )
balance = initialBalance;
}
public void credit( double amount )
{
balance = balance + amount;
}
public void debit(double amount ) {
double newBalance = balance - amount;
if (newBalance < 0) {
System.out.println("Debit amount exceeds balance.");
}
else
balance = newBalance;
}
public double getBalance()
{
return balance;
}
}
package lab.three.one;
public class Account
{
private double balance;
public Account( double initialBalance )
{
if ( initialBalance > 0.0 )
balance = initialBalance;
}
public void credit( double amount )
{
balance = balance + amount;
}
public void debit(double amount ) {
double newBalance = balance - amount;
if (newBalance < 0) {
System.out.println("Debit amount exceeds balance.");
}
else
balance = newBalance;
}
public double getBalance()
{
return balance;
}
}