public class Credit extends Account{ int creditLine; //The total amount of money they may have access to. double interest; //The APR at which they are charged public Credit(int accountNum, int balance, String name, int creditLine, double interest){ super(accountNum, balance, name); this.creditLine = creditLine; this.interest = interest; } //Pay off your credit card bill with a certain amount. //Return the new balance. public int deposit(int amount){ if(balance - amount < 0){ throw new RuntimeException("Cannot have a credit on your account."); }else{ return balance = balance - amount; } } //Spend more money on your credit public int withdraw(int amount){ if(balance + amount > creditLine){ throw new RuntimeException("Cannot spend above your credit line."); }else{ return balance = balance + amount; } } }