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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started