Вы находитесь на странице: 1из 6

-------------------------------------------------------

BANK TRANSACTION - JAVA PROGRAMMING (VERSION 1)


-------------------------------------------------------

1. Style of Programming

a. In this version, there must be only one method (main method).


b. The programming style is top to bottom.

2. Main Menu

Welcome to ABC BANK

B - Check for balance


D - Make deposit
W - Make withdrawal
Q - Quit

Select an option :

3. Balance Amount

a. You can define your current balance as 100,000.

b. Use bal variable name and declare it as double.

double bal = 100000;

4. Case Insensitive

a. When choosing an option from the main menu or responding to


a prompt, the program must accept lower case or upper case
letters and must be treated the same.

b. The user is allowed to enter menu selection either in upper case


or lower case.

c. Make the program in such a way it can handle both lower case and
upper case menu selection.

d. From the main menu, 'b' or 'B' will select the "Check for balance"
option.

5. Validate user response.

a. If user enters an invalid option from the main menu, the system will display
the
error message below.

Invalid entry, enter any valid option : B/D/W/Q

b. If the user enters an invalid option from the prompt below, the system will
display "Invalid entry, enter Y or N only"

Want to Transact another (Y/N)? Y

6. If 'B' is entered from the main menu, the current balance will be displayed.
Your current balance is 100000

Want to Transact another (Y/N)? Y

7. If 'D' is entered from the main menu. The system will ask to enter for
the deposit amount. The deposit amount will be added to the balance.

a. If negative amount is entered

Enter amount to Deposit : -20000

Deposit Amount must be greater than zero

Want to Transact another (Y/N)? y

b. If deposit amount is greater than 500,000 (AMLA compliane)

Enter amount to Deposit : 520000

Deposit Amount must not be greater than 500,000

Want to Transact another (Y/N)? Y

c. If amount is valid, it will be added to the current balance and display


the message below.

Enter amount to Deposit : 20000


Deposit Transaction is successfully completed.

Want to Transact another (Y/N)?y

8. If 'W' is entered from the main menu. The system will ask to enter for
the Withdrawal amount. The withdrawal amount will be deducted from the balance.

a. If withdrawal amount is less than or equal to zero

Enter amount to Withdraw : -9000


Withdrawal Amount must be greater than zero

Want to Transact another (Y/N)?y

b. If withdrawal amount is greater than the balance amount

Enter amount to Withdraw : 150000


Amount must not be greater than 120000

Want to Transact another (Y/N)?

c. If withdrawal amount is not exactly divisible by 100.

Enter amount to Withdraw : 12520


Amount must be divisible by 100

Want to Transact another (Y/N)?

d. If amount is valid, it will be deducted from the current balance and display
the message below.
Enter amount to Withdraw : 30000
Withdrawal Transaction is successfully completed.

Want to Transact another (Y/N)? y

9. If 'Q' is entered from the main menu.

Thank you for using the program

10. After balance inquiry (B), deposit (D) or withdrawal (W), the system will ask
the user if another transaction will be made.

Want to Transact another (Y/N)?

a. If 'Y', the system will display again the MAIN MENU.

b. If 'N', the sytem will be terminated.

Want to Transact another (Y/N)? n

Thank you for using the program

-------------------------------------------------------
SAMPLE PROGRAM OUTPUT
-------------------------------------------------------

1. This is the main menu. If you enter 'x', it will


display an error message.

Welcome to ABC BANK

B - Check for balance


D - Make deposit
W - Make witdrawal
Q - Quit

Select an option : x

Invalid entry, enter any valid option : B/D/W/Q

Want to Transact another (Y/N)?y

2. When you select 'b', it will show you the current balance.

Welcome to ABC BANK

B - Check for balance


D - Make deposit
W - Make witdrawal
Q - Quit

Select an option : b

Your current balance is 100000

Want to Transact another (Y/N)?

3. When you respond an invalid option to this prompt, it will display


an error message and the prompt will be displayed again.

Want to Transact another (Y/N)? x

Invalid Entry. Enter Y or N only

Want to Transact another (Y/N)?

4. When you enter 'd', you will be asked to enter for the deposit amount.
If the amount value is valid, it will display the message
"Deposit Transaction is successfully completed." and the deposit amount
will be added to the balance.

Welcome to ABC BANK

B - Check for balance


D - Make deposit
W - Make witdrawal
Q - Quit

Select an option : d

Enter amount to Deposit : 50000


Deposit Transaction is successfully completed.

Want to Transact another (Y/N)? Y

Welcome to ABC BANK

B - Check for balance


D - Make deposit
W - Make witdrawal
Q - Quit

Select an option : b

Your current balance is 150000

Want to Transact another (Y/N)? Y

5. Deposit amount must be validated.

a. Must not be greater than 500,000

Enter amount to Deposit : 50000000


Deposit Amount must not be greater than 500,000

b. Must not be zero or negative

Enter amount to Deposit : -99999


Deposit Amount must be greater than zero

6. When you enter 'w', you will be asked to enter for the withdrawal amount.
If the amount value is valid, it will display the message
"Withdrawal Transaction is successfully completed." and the witdrawal amount
will be deducted from the balance.

Welcome to ABC BANK

B - Check for balance


D - Make deposit
W - Make witdrawal
Q - Quit

Select an option : w

Enter amount to Withdraw : 25000


Withdrawal Transaction is successfully completed.

Want to Transact another (Y/N)? y

Welcome to ABC BANK

B - Check for balance


D - Make deposit
W - Make witdrawal
Q - Quit

Select an option : b

Your current balance is 125000

Want to Transact another (Y/N)? Y

7. When you select 'q' from the main menu or respond with 'N' on the prompt, you
will
exit from the program.

Welcome to ABC BANK

B - Check for balance


D - Make deposit
W - Make witdrawal
Q - Quit

Select an option : q

Thank you for using the program

8. When you respond with 'N' on the prompt, you will exit from the program.

Welcome to ABC BANK

B - Check for balance


D - Make deposit
W - Make witdrawal
Q - Quit
Select an option : b

Your current balance is 100000

Want to Transact another (Y/N)?n

Thank you for using the program

Вам также может понравиться