Answer the given question with a proper explanation and step-by-step solution.   Using Java Create an BankAccount Class that has an account id number (of type integer), balance (of type double), and rate (of type double) as private data. Add get and set methods for these three variables to work with these attributes. Make overloaded constructors to bring in and set all values, and also to just to bring in a customer name and id which uses 0 for the balance. Include error handling in the set for the balance which throws an exception if a change would put the balance below 0. In Main of another class file create 2-3 objects of BankAccount and work with their values and output them to the user to test your new class. Take the BankAccount Class from above and copy it into this program. You will use it as one of the classes in this one. Create a BankCustomer class with 3 BankAccount objects inside it as private variables (of type BankAccount) as well as a customer name (of type String). [The three accounts are for checking, savings, and money market.] Add get and set methods for these three variables to work with these attributes. The constructors you make are up to you on this class. In Main of another class file create two BankCustomers, with their names and all account information and the values in them for the user. Then add 1000 to the checking account of the first one and 500 to the savings account of the second one and print all account information and the values in them for the user to test your new class and working with its internal objects through the outer class.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Answer the given question with a proper explanation and step-by-step solution.

 

Using Java

Create an BankAccount Class that has an account id number (of type integer), balance (of type double), and rate (of type double) as private data. Add get and set methods for these three variables to work with these attributes. Make overloaded constructors to bring in and set all values, and also to just to bring in a customer name and id which uses 0 for the balance. Include error handling in the set for the balance which throws an exception if a change would put the balance below 0. In Main of another class file create 2-3 objects of BankAccount and work with their values and output them to the user to test your new class.

Take the BankAccount Class from above and copy it into this program. You will use it as one of the classes in this one. Create a BankCustomer class with 3 BankAccount objects inside it as private variables (of type BankAccount) as well as a customer name (of type String). [The three accounts are for checking, savings, and money market.] Add get and set methods for these three variables to work with these attributes. The constructors you make are up to you on this class. In Main of another class file create two BankCustomers, with their names and all account information and the values in them for the user. Then add 1000 to the checking account of the first one and 500 to the savings account of the second one and print all account information and the values in them for the user to test your new class and working with its internal objects through the outer class.

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Math class and its different methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education