We read your photo as:

Describe the process for transferring and withdrawing money, including any fees and balance checks.

Computer Science

ScanSolve AI Answer

Here are the answers for Question Four:

a) To Transfer Money:
To transfer money, the system should perform the following checks and actions:

  • Prompt the user to enter the recipient's phone number, the transfer amount, and their personal identification number (PIN).
  • Verify if the entered PIN matches the user's my_pin.
  • Calculate the total amount to be deducted, which is the transfer_amount plus a 5% service fee. Total Deduction=transfer_amount+(transfer_amount×0.05)\text{Total Deduction} = \text{transfer\_amount} + (\text{transfer\_amount} \times 0.05)
  • Check if the current_balance is greater than or equal to the Total Deduction.
  • If all conditions are met, deduct the Total Deduction from the current_balance and confirm the transfer. Otherwise, display an error message (e.g., "Invalid PIN" or "Insufficient Balance").

b) To Withdraw Money:
To withdraw money, the system should perform the following checks and actions:

  • Prompt the user to enter the withdrawal amount and their PIN.
  • Verify if the entered PIN matches the user's my_pin.
  • Calculate the total amount to be deducted, which is the withdrawal_amount plus a 5% service fee. Total Deduction=withdrawal_amount+(withdrawal_amount×0.05)\text{Total Deduction} = \text{withdrawal\_amount} + (\text{withdrawal\_amount} \times 0.05)
  • Check if the current_balance is strictly greater than the Total Deduction.
  • If all conditions are met, deduct the Total Deduction from the current_balance and confirm the withdrawal. Otherwise, display an error message (e.g., "Invalid PIN" or "Insufficient Balance").

c) To Deposit Money:
To deposit money, the system should perform the following checks and actions:

  • Prompt the user to enter the deposit amount.
  • Check if the deposit_amount is greater than 500.
  • If the condition is met, add the deposit_amount to the current_balance. current_balance=current_balance+deposit_amount\text{current\_balance} = \text{current\_balance} + \text{deposit\_amount}
  • Confirm the deposit. Otherwise, display an error message (e.g., "Deposit amount must be greater than 500").

d) To Check Account Balance:
To check the account balance, the system should perform the following checks and actions:

  • Prompt the user to enter their PIN.
  • Verify if the entered PIN matches the user's my_pin.
  • If the PIN is valid, display the current_balance. Otherwise, display an error message (e.g., "Invalid PIN").

e) Three Chances for PIN:
The system should implement a counter for incorrect PIN attempts.

  • Initialize a variable, for example, pin_attempts, to 0.
  • Whenever a PIN is required (for transfer, withdrawal, or balance check), allow the user up to three attempts to enter the correct PIN.
  • If an incorrect PIN is entered, increment pin_attempts.
  • If pin_attempts reaches 3, the account should be locked, preventing further transactions until it is unlocked by an administrator or a recovery process.
  • If the correct PIN is entered within three attempts, reset pin_attempts to 0 and proceed with the requested transaction.
Was this helpful?

Still stuck on this one?

Ask a follow-up, and the answer starts from this question.

Got a different question?Ask your own question
Handwritten step-by-step solution preview

Handwritten Step-by-Step Solution

Get this as a handwritten image on WhatsApp — like a tutor wrote it for you.

Try on WhatsApp