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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

JAVA PROGRAM 

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
Transcribed Image Text: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
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education