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
Step: 1
public class BankCustomer Private instance variables private String customername private String cust...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