Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ATM Case Study Objective A local bank intends to install a new automated teller

ID: 3707045 • Letter: A

Question

ATM Case Study

Objective

A local bank intends to install a new automated teller machine (ATM) to allow users (i.e., bank customers) to perform basic financial transactions. You have to develop software to perform the financial transactions initiated by bank customers through the ATM.

Requirements

Software should encapsulate the functionality of the hardware devices within software components, but it need not concern itself with how these devices perform their duties. Use the computer’s monitor to simulate the ATM’s screen, and the computer’s keyboard to simulate the ATM’s keypad.

The ATM software system meets the following requirements.

Each user can have multiple accounts at the bank.

ATM users can perform the following actions:

fast cash (withdraw $20 - $100);

transfer money from one account to another;

withdraw cash (max $400);

deposit funds;

perform balance inquiry;

receive mini-statement (e.g., last 10 transactions).

An ATM session consists of

authenticating a user based on an account number and personal identification number (PIN);

creating and executing financial transactions.

To authenticate a user and perform transactions:

interact with the bank’s account information database;

for each account, the database stores an owner name, an account number, a PIN and a balance indicating the amount of money in the account. Additionally,

savings account stores a rate that represents the annual interest;

checking account stores a fee that represents the cost of clearing one check.

Note: You have to choose a bank and learn their terms and rules for different types of accounts. You have to come up with a few more requirements and implementation details in the design of your ATM system based on the bank of your choice.

Assumptions

the bank plans to build only one ATM, so we need not worry about multiple ATMs accessing this database at the same time;

the bank does not make any changes to the information in the database while a user is accessing the ATM;

an ATM faces reasonably complicated security issues (you should come up with a few solutions in your design);

the bank trusts the ATM to access and manipulate the information in the database without significant security measures.

Implementation Details

ATM user interface

a screen that displays messages to the user;

a keypad that receives numeric input from the user;

a cash dispenser that dispenses cash to the user and;

a deposit slot that receives deposit envelopes from the user;

a printer slot that sends receipts of the transactions;

a card reader.

The cash dispenser begins each day loaded with 500 $20 bills.

Explanation / Answer

public class ATM {
  
// Create instance variables
  
private String accountNumber, firstName, lastName;
private Double accountBalance;
  
// initializing constructor
  
public ATM ()
{
accountNumber = "";
firstName = "";
lastName = "";
accountBalance = 0.0;
}
// set
  
public void setAccountNumber (String account)
{
accountNumber = account;
}
//get
public String getAccountNumber()
{
return accountNumber;
}
// set
  
public void setFirstName(String first)
{
firstName = first;
}
// get
public String getFirstName()
{
return firstName;
}
// set
public void setLastName(String last)
{
lastName = last;
}
// get
public String getLastName()
{
return lastName;
}
// set
public void setAccountBalance(double balance)
{
accountBalance = balance;
}
// get
public double getAccountBalance()
{
return accountBalance;
}
// Inital Balance
public void setInitialBalance(double initialBalance)
{
if (initialBalance > 0.0)
accountBalance = initialBalance;
}
public void withdrawal(double newBalance, double amount)
{
newBalance = accountBalance - amount;
System.out.println("You withdrew: " + amount);
System.out.println("Your balance is: " + newBalance);
}

// Deposit

public void deposit (double newBalance, double amount)
{
newBalance = accountBalance + amount;
System.out.println("You gave me: $ " + amount);
System.out.println("I now have all your money that is worth: " + newBalance);
}

private Double withdrawal(int amount)
{
double withdrawal;
balance = balance - amount;
return balance;
}

private Double deposit(int amount)
{
double deposit;
balance = balance + amount;
return balance;
}

}

________________________________________________________________________________________________________________________________
________________________________________________________________________________________________________________________________

import java.util.Scanner;

public class ATMTest {
public static void main (String args[])
{
ATM myATM = new ATM();
}
int choice;
int debit;
int credit;
int balance;
double amount;
double methodOutput;

Scanner input = new Scanner(System.in);

do
{

System.out.println("0.fastCash 20$-100$);
System.out.println("1. Withdrawal, max 400$");
System.out.println("2. Deposit");
System.out.println("3. Get Balance");
System.out.println("4. Exit");

choice = input.nextInt();
if (choice == 0)
{
System.out.println("Enter the amount you want to withdraw, please: ");

amount=input.nextInt();

if(amount>=20 && amount<=100)

{
methodOutput = withdrawal (amount);

}

else

{

System.out.println("invalid amount");

}
}
if (choice == 1)
{
System.out.println("Enter the amount you want to withdraw, please: ");

amount = input.nextInt();

if(amount<=400)

{
methodOutput = withdrawal (amount);

}

else

{

System.out.println("Invalid withdrawal amount");

}
}
  
if (choice == 2)
{
System.out.println("Enter the amount you will deposit: ");
choice = input.nextInt();
methodOutput = deposit(amount);
}

if (choice == 3)
{
System.out.println("The available amount of cash to take from me is: ");
}

if (choice == 4)
{
System.out.println("See ya later " + firstName + lastName);
}
}
while (choice != 4);


}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote