Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Objective Learn how to use and implement the concept of Inheritance (which supports reuse) interface, abstract classes, composition, exception and File I/O. Program

In Java
Objective
Learn how to use and implement the concept of Inheritance (which supports reuse) interface, abstract classes, composition, exception and File I/O.
Program Description
The purpose of this project is to design a simulation of Bank website. The Bank website is used by the users of the bank branch. Each branch has users. Each user also has one account only, a user name, balance (default value 0.0), number and a personal identification number (PIN). In this simulation, the user will need to type the PIN as identifier. There are three types of users:
User has an open normal account: can withdraw and deposit any amount of money; and can inquire about the balance
User has a controlled account: can withdraw maximum 2000 SR per day and deposit any amount of money
User has a restricted account: can withdraw maximum 500 SR per day and deposit any amount of money
Note: In any case you cannot withdraw if the balance less than the amount of withdraw.
You must display the following menu to the user: ------------------------------------------------------------------------------------------------------------
Welcome To the bank website
------------------------------------------------------------------------------------------------------ -----
1. Create account
2. Exit from website
Enter Your Choice:
According to user type, show all possible operations
1. Deposit
2. Withdraw
3. Balance
4. Transfer
5. Return to main menu
Enter Your Choice:
You must have the following in your program:
(a) Abstract user contains balance, abstract withdraw method and constructors.
(b) Interface FreeDepositAndInquiry contains void method deposit (double) , void
Transfer(double) and double getBalance().
(c) Interface LimitedDeposit contains void method deposit(double) class (d) Class NormalAccount: is a subclass from user implements the interface
FreeDepositAndInquiry. This class represents the user that has an open normal
account.
(e) Class ControlledAccount: is a subclass from user implements the interface
LimitedDeposit. This class represents the user that has a Controlled account.
(f) Class RestricteAccount: is a subclass from user. This class represents the user that
has a restricted account.
Run sample
run:
Welcome to THE BANK WEBSITE
1 : Open a new account
2: Exit
---------- Enter Your Choice----------- 1
----------- Enter Account Type ------------- ----------- 1: Open Normal Account ------------- ----------- 2: Controlled Account ------------- ----------- 3: Restricted account -------------
1
----------- Enter Operation type ------------- ----------- 1: Deposit -------------
----------- 2: Witdraw -------------
----------- 3: Balance -------------
----------- 4: Transfer ------------- ----------- 5: Main Menu -------------
1
Enter amount
2500
----------- Enter Operation type ------------- ----------- 1: Deposit -------------
----------- 2: Witdraw -------------
----------- 3: Balance ------------- ----------- 4: transfer -------------
----------- 5: Main Menu ------------- 3
balance is :2500.0
----------- Enter Operation type ------------- ----------- 1: Deposit -------------
----------- 2: Witdraw -------------
----------- 3: Balance -------------
----------- 4: transfer ------------- ----------- 5: Main Menu -------------
2
Enter amount
1000
----------- Enter Operation type ------------- ----------- 1: Deposit -------------
----------- 2: Witdraw -------------
----------- 3: Balance -------------
----------- 4: transfer ------------- ----------- 5: Main Menu -------------
3
balance is :1500.0
----------- Enter Operation type ------------- ----------- 1: Deposit -------------
----------- 2: Witdraw -------------
----------- 3: Balance ------------- ----------- 4: transfer -------------
----------- 5: Main Menu ------------- 1
Enter amount 3500
----------- Enter Operation type ------------- ----------- 1: Deposit -------------
----------- 2: Witdraw -------------
----------- 3: Balance -------------
----------- 4: transfer ------------- ----------- 5: Main Menu -------------
3
balance is :5000.0
----------- Enter Operation type ------------- ----------- 1: Deposit -------------
----------- 2: Witdraw -------------
----------- 3: Balance -------------
----------- 4: transfer -------------
----------- 5: Main Menu -------------
4
Enter amount
20000
There is no enough balance!
----------- Enter Operation type ------------- ----------- 1: Deposit -------------
----------- 2: Witdraw -------------
----------- 3: Balance -------------
----------- 4: transfer ------------- ----------- 5: Main Menu -------------
5
Welcome to THE BANK WEBSITE
1 : Open a new account
2: Exit
---------- Enter Your Choice-----------
2
BUILD SUCCESSFUL (total time: 1 minute 16 seconds)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions