he Identity of the Customer it belongs to. The program should run in a loop; continuously asking the user to enter the basic details of the customer and their account. After getting all details about a Customer and their corresponding accounts, the program should ask the user whether he/she wants to enter the detail of another customer. The above process should continue if the user enters “Y” for Yes. The program should terminate and display a list of the entered customers and their accounts if the user enters “N” for No.
JAVA
Write a program named AccountManager which stores customers’ details including their
accounts. A customer can have more than one accounts. You can achieve this by introducing two
classes i.e. Customer and Account. The Account class will have a data member named
CustomerID which will store the Identity of the Customer it belongs to.
The program should run in a loop; continuously asking the user to enter the basic details of the
customer and their account. After getting all details about a Customer and their corresponding
accounts, the program should ask the user whether he/she wants to enter the detail of another
customer. The above process should continue if the user enters “Y” for Yes. The program should
terminate and display a list of the entered customers and their accounts if the user enters “N” for
No.
The program must be user-friendly. Part of this problem is to get practice writing programs that
are robust to user input errors, so you should check user input for errors, such as value that is
invalid, or beyond the bounds. One account is associated to one customer only and a customer
may have zero, one or more accounts. While getting a new account number, the program must
check if the given account number is already associated with another customer.
If an error is detected, the program should print a helpful message and allow the user to try again.
Here is a sample of what an interactive session might look like:
Please Enter Customer Details
Customer ID: 123
Customer Name: Ali Hassan
Phone Office: 0454455334
Cell No: 03004400506
Billing Address: House No. 123, Nowhere.
CNIC No. 33102-7748298-5
Do you want to enter Ali Hassan’s Account Details? (Y/N): Y
(Here, we are not asking user to enter the Customer ID because it
is understood that we are going to enter Ali Hassan’s account
detail so we will set CustomerID field of the Account class as 123
at backend).
Enter Account No: 19154400556743
Bank: Habib Bank
Bank Branch: UET Taxila
Account Type (Enter C: Current, S: Saving, P: PLS): P
Current Balance (Rs.): 33,000
Do you want to enter Ali Hassan’s another account Detail? Y
Enter Account No: 037655445674
Bank: Allied Bank Ltd.
Bank Branch: GT Road, Taxila
Account Type (Enter C: Current, S: Saving, P: PLS): C
Current Balance (Rs.): 25,000
Do you want to enter Ali Hassan’s another account Detail? N
Do you want to enter another customer’s details? (Y/N) N
![n nang
Yaucanaiv ti by iruducing ta
Waa pgra
Acater
d Cn N
Catt w
The
ad dr
, the pgram
adaar. The abee prc ddcoi d Ye The pregun ddd
sia nd diaplayala ef the d acanand hairac ifhe mar en "N
Na
lamager
Ac cla
Idenity of the
r hae daaofe
rnd their conspanding
ur te deud ef er
The progam at ba rindly. Part of dis prble i te get pactice writing progan tu
epu , yos d dek r i a, l t
ialid, or heyand e bound One accoat is amacianed te on canar only nda autna
ay lave aur, n a W piaga wac bar, the paga ue
Man ameri dacd, he progan osld priar a halpl eage and allow the aro try aga.
Hku kample of wat an immaive skon might kook lke
Please Enter Customer Details
Customer ID: 12a
Custoner Name: A aan
Phone Office: 45ASS4
Cell No: 00saesas
lling Address: ouse No. 121, Nouhere.
Do you want to enter Ali Hassan's ccount Details? (v/N): V
(ere, e are nat asring uner to anter the Customer D becouse it
ie understood that we ore gotng to enter ALi Hasan's account
detall so e wlLL set Customero fleld of the Account class as 123
at bachend).
Enter Account Ne: 1as440esse7a
Rank: Habib Bank
Bank Branch: UET Tasila
Account Type (Enter C: Current, S: Saving, P: PLS): P
Current Balance (as.): 13,000
Do you want to enter All Hassan's another account Detad1? Y
Enter Account Na: a376sS44SE74
ank: Allied Bank Ltd.
kank iranch: GT Aaad, Taadla
Account Type (Enter C: Current, S: Saving, P: PLS): C
Lab karar: Mahammad Fahem Sam
jea rieed oganning
Sani-CS- K3
UNIVERSITY OF ENGINEERING AND TECHNOLOGY. JAXILA
FACULTY OF TELECOMEMUNICATION AND INFORMATION ENGINEERING
Department Of Computer Science
Current Balance (as.): 25,000
Do you want to enter Ali Hassan's another account Detad1?N
Do you want to enter ansther ustoner's detalis? (V/N) N
Requirad Cup
Custaner Details
L, ere
aan
Account Detadls
Account No.
Type
PLS
76SS445E4 ALLLed lank Ltd. GT Raad, Tasila Current
ank
Branch
Balance
22, e
25, 00
19154essEa Bank abib Bank UST Tasila](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fa52a4d42-ca54-4621-8216-2ecf6cb75865%2Fca3e3f9c-032a-42b6-88ff-bfc75ab5de98%2Finqwqu_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)