Question: make 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[],

make 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 a constructor method. (2 pts)

Add a public get method for instance variables:

customer_name, customer_id, saving_accounts, and number_of_accounts. (4 pts)

Add a public set method 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." (8 pts)

Page | 2

6. Add a main method in which you should create three BankCustomer objects. (5 pts)

Step by Step Solution

3.28 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class BankCustomer Private instance variables private String customername private String cust... View full answer

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 Operating System Questions!