Question: Problem 3 ( 2 5 pts ) Create a class named BankCustomer. A bank customer should include four pieces of information as customer _ id

Problem 3(25 pts)
Create a class named BankCustomer. A bank customer should include four pieces of information as customer_id (type String), customer_id (type String), saving_accounts (type SavingAccount[], an array of saving accounts from problem 2), and number_of_accounts (type int, initial=0)
-customer_name: String
-customer_id: String
-saving_accounts: SavingAccount[]
-number_of_accounts: int
Where saving_accounts should be an array that can hold up to five saving accounts, and number_of_accounts represents the number of accounts that this bank customer owns. If this bank customer has owned five saving accounts, he/she cannot open another one.
Add the private instance variables listed above to the BankCustomer class. (4 pts)
Add two constructor methods, one is the default constructor. (5 pts)
Add public get methods for instance variables:
customer_name, customer_id, saving_accounts, and number_of_accounts. (4pts)
Add public set methods for instance variables: customer_name and customer_id.(2 pts)
Add a public method named open_new_account(SavingAccount acc, double dep_amt) to open a new saving account for this customer and deposit the given amount, dep_amt, into this saving account.
If this bank customer has owned five saving accounts, he/she cannot open another one. Display "cannot open a new account because you already have five accounts." (10 pts)
Problem 3 ( 2 5 pts ) Create a class named

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 Programming Questions!