Here is my code:
import java.util.*;
public class SavingAccount extends BankAccount
{ // Begin public class SavingAccount extends BankAccount
private double minAmount;
public boolean withdraw(double amount)
{ // Begin public boolean withdraw(double amount)
if (getbalance() >= amount + minAmount)
{ // Begin if statement
super.withdraw(amount);
return true;
} // End if statement
else
{ // Begin else statement
return false;
} // End else statement
} // End public boolean withdraw(double amount)
} // End public class SavingAccount extends BankAccount
private int numberOfWithdrawals = 0;
public SavingAccount()
{ // Begin public SavingAccount
balance = 0;
numberOfWithdrawals = 0;
} // End public SavingAccount
public void withdraw(int amount)
{ // Begin public voidwithdraw(int amount)
if(numberOfWithdrawals > 4)
{ // Begin if statement
throw newRuntimeException(if the withdrawls >4 a service charge of 1$ is charged);
} // End if statement
else
{ // Begin else statement
balance = balance amount;
numberOfWithdrawals++;
} // End else statement
} // End publicvoidwithdraw(int amount)
public void resetNumOfWithdrawals()
{ // Begin public voidresetNumOfWithdrawals()
} // End public voidresetNumOfWithrawals()
I am getting the following class, interface, or enum expected error messages:
java:23: class, interface, or enum expected
private int numberOfWithdrawals = 0;
^
java:25: class, interface, or enum expected
public SavingAccount()
^
java:28: class, interface, or enum expected
numberOfWithdrawals = 0;
^
java:29: class, interface, or enum expected
} // End public SavingAccount
^
java:31: class, interface, or enum expected
public void withdraw(int amount)
^
java:36: class, interface, or enum expected
} // End if statement
^
java:40: class, interface, or enum expected
numberOfWithdrawals++;
^
java:41: class, interface, or enum expected
} // End else statement
^
java:44: class, interface, or enum expected
public void resetNumOfWithdrawals()
Please help!