Question: Write a Java Program to Create a class Account with the variables to represent the account holders name, account number, account type (S for savings

Write a Java Program to Create a class Account with the variables to represent the account holders name, account number, account type (S for savings and C for Current), balance amount, use constructor to initilize the variables. Write method to deposit money, withdrawal of money, mutator and accessor methods, toString method to return object as a string. Throw an Exception for negative balance.

Create Driver class to read the account holders name, account number, account type, initial balance amount. Check if the name is valid name, throw InputMismatchException if invalid, also check validity of the account number, account type, initial balance amount, if invalid throw InputMismatchException and reenter the data. Create an object of Account.

Please provide the code with Output

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!