Question: public class BankDemo {pubic static void main(String [] args) {CheckingAccount c = new CheckingAccount (101); System.out.printIn(Depositing $500...); c.deposit(500.00); try {System.out.printIn( Wi thdrawing $100...); c.withdraw(100.00); System.out.printIN(

 public class BankDemo {pubic static void main(String [] args) {CheckingAccount c

public class BankDemo {pubic static void main(String [] args) {CheckingAccount c = new CheckingAccount (101); System.out.printIn("Depositing $500..."); c.deposit(500.00); try {System.out.printIn(" Wi thdrawing $100..."); c.withdraw(100.00); System.out.printIN(" Wi thdrawing $600..."); c. withdaw (600.00);} catch (insufficientFundsCeption e){System.out.printIn)"Sorry, but you are short $" + e.getAmount()); e.printStackTrace();}}} Create class NBAPlayer(name, age, years_pro}. Create class ValueOutOfRangeException. Create a Driver (or Main) class with a main() function. Use a Scanner to read the name, age. and years.pro. Use ctors to instantiate an NBAPlayer object for the data collected. The ctor throws the above exception if the age is less than 16, or the years_pro is less than zero. Test your program with: 1)values that will not cause an exception, then 2) with values that will cause an exception due to age

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!