HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
장지원 페이지/
[Notion] :
[Notion] :
/
🏧
ATM
/
test_case (1)

test_case (1)

 

 
input
bank1: Kakao bank2: Daegu
 
acc1: Kakao, David, 111111111111, 1004, 20000 acc2: Daegu, Jane, 222222222222, 2435, 100000 acc3: Kakao, Kate, 333333333333, 9876, 150000
acc4: Kakao, David, 444444444444, 8282, 400000
acc4: Daegu, David, 555555555555, 2468, 200000
 
ATM1: Kakao, 111111, type 2, lang 2, [ 10, 10, 10, 10 ]
ATM2: Daegu, 222222, type 1, lang 1, [ 10, 10, 10, 10 ]
 
ATM serial number: 111111
language: Ko
insert card: 111111111111
password: 1004
 
 
 
 
(REQ1.11) All accounts and ATMs shall be created and initialized during the program execution.
During the program execution, the necessary information to create accounts and ATMs shall be given from a user via console input (i.e., hard coding of account and ATM information is not allowed).
The accounts and ATMs shall be created and initialized based on the user input.
[Banks] bank1: Kakao bank2: Daegu
notion image
[Accounts] acc1: Kakao, David, 111111111111, 1004, 20000 acc2: Daegu, Jane, 222222222222, 2435, 100000 acc3: Kakao, Kate, 333333333333, 9876, 150000
notion image
(REQ1.6) A user may have multiple Accounts in a Bank.
acc4: Kakao, David, 444444444444, 8282, 400000
(REQ1.7) A user may have Accounts in multiple Banks.
acc4: Daegu, David, 555555555555, 2468, 200000
 
[ATM]
ATM1: Kakao, 111111, type 2, lang 2, [ 10, 10, 10, 10 ]
ATM2: Daegu, 222222, type 1, lang 1, [ 10, 10, 10, 10 ]
notion image
(REQ1.1) An ATM has a 6-digit serial number that can be uniquely identified among all ATMs (e.g., 315785).
(REQ1.2) An ATM is set to one of the following types: (1) Single Bank ATM, (2) Multi-Bank ATM.
For Single Bank ATM, the ATM is belonged to a primary bank, and only a card issued by the primary bank is considered valid.
For Multi-Bank ATM, there is a primary bank that manages the ATM, but a card issued by any other banks is considered valid.
(REQ1.3) An ATM may support either unilingual or bilingual languages.
When an ATM is configured unilingual, all information is displayed in English only.
When an ATM is configured bilingual, a user can choose if the information is to be displayed either English or Korean (Note: if you know only one of the languages, consider using a language translation service, such as Google Translation)
(REQ1.4) A Bank deposits a certain amount of cashes to an ATM to serve users.
 

 
[Session]
(REQ1.5) A Bank can open an Account for user with necessary information to perform bank services.
(e.g.) Bank name (e.g, Kakao, Shinhan), User name, Account number (12-digit), Available funds, Transaction histories.
ATM serial number: 111111
language: Ko
(REQ8.1) An ATM that is configured with the bilingual support shall provide an option for a user to choose the preferred language either English or Korean. (REQ8.2) Once a certain language is chosen, all menus must be displayed using the chosen language.
insert card: 111111111111
(REQ2.1) A session starts when a user inserts a card.
 
[Session deposit]
(REQ1.10) An ATM only accepts and returns the following types of cashes and checks.
(Cash type) KRW 1,000, KRW 5,000, KRW 10,000, KRW 50,000
(Check type) Any amount over KRW 100,000 check (e.g., KRW 100,000, 100,001, 234,567 are all valid checks)
 
[Admin session]
insert card : 000000
(REQ1.9) An admin can access the menu of “Transaction History” via an admin card (See REQ Display of Transaction History).
 
[Session end]
(REQ2.2) A session ends whenever a user wishes (e.g., by choosing a cancel button) or there are some exceptional conditions detected by the ATM (e.g., no cash available)
(REQ2.3) When a session ends, the summary of all transactions performed in a session must be displayed.
(e.g.) Account/card info, transaction types (deposit, transfer, withdrawal), and their amount, …
(REQ2.4) Each transaction has a unique identifier across all sessions.
notion image
(REQ3.1) An ATM checks if the inserted card is valid for the current type of ATM.
(REQ3.2) If an invalid card is inserted, the ATM shall display an appropriate error message (e.g., Invalid Card).
222222번 ATM은 primary bank가 Daegu 은행인 single bank type ATM 이므로, Kakao 은행의 account인 111111111111 카드를 입력하면 invalid card로 판단하고 세션을 종료시킨다.
notion image
(REQ3.3) An ATM shall ask a user to enter the password (e.g., Enter Password), and verify if the password is correct.
An ATM does not maintain any user information, so the card and password information need to be passed to the bank; then, the bank verifies the password, and return the authorization result. (Bank has the account list, ATM verifies the password by checking the account list in the bank)
(REQ3.4) If the entered password is incorrect, the ATM shall display an appropriate error message. (e.g., Wrong Password)
(REQ3.5) If a user enters wrong passwords 3 times in a row, a session is aborted, and return the card to the user.
Daegu 은행의 account 222222222222의 비밀번호는 2435이므로, 틀린 비밀번호인 5768, 0123, 5342를 순서대로 입력하면 세션이 종료된다.
notion image
notion image
(REQ4.1) An ATM shall take either cash or check from a user.
o (REQ1.8) Each ATM have several types of transaction fees, and paid as follows:
  • Deposit fee for primary banks: KRW 0
222222222222 account는 처음 100,000원의 잔액을 가지고 있었다. Cash Deposit으로 1000원권을 3장 예금하였으므로 계좌의 잔액은 103,000원으로 바뀌며, 222222 ATM가 보유한 1000원권 금액이 3000원 증가한다.
notion image
After cash deposit, 3000 won has decreased in ATM balance, increased in the Daegu Account
 
 
 
(REQ4.3) Once cash or checks are accepted by ATM, the transaction must be reflected to the bank account as well (i.e., the same amount of fund must be added to the corresponding bank account)
 
notion image
 
REQ4.2) An ATM shall display an appropriate error message if the number of the inserted cash or checks exceed the limit allowed by the ATM. (Cash Deposit limit is about 30 paper cashes)
 
notion image
(REQ2.3) When a session ends, the summary of all transactions performed in a session must be displayed.
Deposit for 222222222222 → Total Balance of the Account : 117000
 
 
notion image
 
(REQ8.1) An ATM that is configured with the bilingual support shall provide an option for a user to choose the preferred language either English or Korean. (REQ8.2) Once a certain language is chosen, all menus must be displayed using the chosen language.
(ATM: Kakao, Account: Daegu)
As ATM supports bilingual, user can choose the language between English and Korean.
The case above selects “Korean”, therefore all menus are displayed in Korean.
 
 
notion image
(REQ4.4) Some deposit fee may be charged (See REQ in System Setup)
(REQ1.8) Each ATM have several types of transaction fees, and paid as follows:
  • Deposit fee for non-primary banks: KRW 1,000; the fee is paid by inserting additional cash.
 
 
Acc: 117000 → 127000 (10000 KRW / Cash Deposit) / 20000 → 31000 (11 (10 Paper Cash + Fee))
According to the bank of the account, this is the non-primary bank transaction.
ATM asks user to deposit extra fee (1000 KRW), therefore remaining 1000 KRW balance become 31.
 
 
notion image
(REQ4.4) Some deposit fee may be charged (See REQ in System Setup)
(REQ1.8) Each ATM have several types of transaction fees, and paid as follows:
  • Deposit fee for non-primary banks: KRW 1,000; the fee is paid by inserting additional cash.
(REQ4.6) The deposited check does not increase available cash in ATM that can be used by other users.
 
Acc: 127000 → 169000 (42000 KRW / Check Deposit) / 31000 → 32000 (1000 KRW for fee)
According to the bank of the account, this is the non-primary bank transaction.
Check deposit doesn’t change the available cash in ATM, however due to the extra fee, 1000 KRW increases in ATM Balance.