Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

How do books become world of wonder?

Answered: 1 week ago

Question

If ( A^2 - A + I = 0 ), then inverse of matrix ( A ) is?

Answered: 1 week ago