Question: Problem 3 ( 2 5 pts ) Create a class named BankCustomer. A bank customer should include four pieces of information as customer _ id
Problem pts
Create a class named BankCustomer. A bank customer should include four pieces of information as customerid type String customerid type String savingaccounts type SavingAccount an array of saving accounts from problem and numberofaccounts type int, initial
customername: String
customerid: String
savingaccounts: SavingAccount
numberofaccounts: int
Where savingaccounts should be an array that can hold up to five saving accounts, and numberofaccounts represents the number of accounts that this bank customer owns. If this bank customer has owned five saving accounts, heshe cannot open another one.
Add the private instance variables listed above to the BankCustomer class. pts
Add two constructor methods, one is the default constructor. pts
Add public get methods for instance variables:
customername, customerid savingaccounts, and numberofaccounts. pts
Add public set methods for instance variables: customername and customerid pts
Add a public method named opennewaccountSavingAccount acc, double depamt to open a new saving account for this customer and deposit the given amount, depamt, into this saving account.
If this bank customer has owned five saving accounts, heshe cannot open another one. Display "cannot open a new account because you already have five accounts." pts
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
