Question

In: Computer Science

1. This programming assignment will involve the idea of modern-day banking using an automated teller machine...

1. This programming assignment will involve the idea of modern-day banking using an automated teller machine (ATM). The server-side software maintains a bank account and a user accesses the account via client software. For this program, you can assume that a single account will be accessed by a single user. This avoids synchronization problems with multiple users. There must be two sides to this program: a server and a client. The server maintains the balance and does all updates (withdrawals and deposits) and also responds to queries on the amount of money in the account. The user issues commands via the client to check the available balance, withdraw money from the account, and deposit money into the account. The client does none of the calculations but only sends requests to the server that executes the commands and returns the answer to the client. The server should initialize the balance in the bank account to $100.

2. The user must be able to do the following activities from the client software:

• Deposit money into the account on the server.

• Withdraw money from the account on the server.

• Check the balance of the amount in the account on the server.

3. Instructions

• The programs MUST be written in the programming language ***Python 3***.

Solutions

Expert Solution

Code for above program :-

# function for ATM machine features
def ATM(balance):
    print("Select a option:")
    print("d : deposit money")
    print("w : withdraw money")
    print("c : check balance")
    print("q : quit")
    # Asking user for the desired operation
    option = input("Enter your choice: ")
    # Checking for deposit operation
    if option =="d":
        # amount to be deposited
        amount = float(input("Enter amount to deposit: "))
        # updating balance
        balance = balance + amount
        # displaying updated balnce
        print("Your account balance is : ${}".format(balance))
        # again calling ATM function
        ATM(balance)
    # withdrawal operation
    elif option=="w":
        # amount to be withdrawed
        amount = float(input("Enter amount to withdraw: "))
        #  amount to be withdrawl greater than balance
        if amount> balance:
            print("You dont have enough balance to withdraw:")
            # displaying updated balnce
            print("Your account balance is : ${}".format(balance))
            # again calling ATM function
            ATM(balance)
        # if amount under balance
        else:
            # updated balance
            balance = balance - amount
            print("${} withdrawl from your account".format(amount))
            # displaying updated balnce
            print("Your account balance is : ${}".format(balance))
            # again calling ATM function
            ATM(balance)
    #  check balance operation
    elif option == 'c':
        # displaying balnce
        print("Your account balance is : ${}".format(balance))
        # again calling ATM function
        ATM(balance)
    # quiting from server
    elif option == 'q':
        return balance
    # check for invalid input
    else:
        print("Invalid Input")
        ATM(balance)
    return balance
# initialising account balance to $100
balance = 100
# calling main function
balance = ATM(balance)

Screenshot For above code :-


Related Solutions

Consider requirements and technology for an analysis of an Automated Teller Machine (ATM) design. Type an...
Consider requirements and technology for an analysis of an Automated Teller Machine (ATM) design. Type an outline out for an ATM system design using the below HCI criteria. Use eye-tracker data to further analyze the product Consider accessibility (universal usability) issues such as lighting, physical placement of ATM, etc. Consider user profile issues, e.g. is this the first time a user is using an ATM? Requirement to perform beta and/or market tests? Are there other stress factors such as a...
A bank operates an automated teller machine (ATM) in which users provide a personal identification number...
A bank operates an automated teller machine (ATM) in which users provide a personal identification number (PIN) and a card for account access. Give examples of confidentiality, integrity, and availability requirements associated with the system and indicate the degree of importance of each requirement. Short Essay Question
When you use an automated teller machine (ATM) with your bank card, you need to use...
When you use an automated teller machine (ATM) with your bank card, you need to use a personal identification number (PIN) to access your account. If a user fails more than three times when entering the PIN, the machine will block the card. Assume that the user's PIN is "1234" and write a program in python that asks the user for the PIN no more than three times, and does the following: 1. If the user enters the right number,...
IN PYTHON When you use an automated teller machine (ATM) with your bank card, you need...
IN PYTHON When you use an automated teller machine (ATM) with your bank card, you need to use a personal identification number (PIN) to access your account. If a user fails more than three times when entering the PIN, the machine will block the card. Assume that the user’s PIN is “1234” and write a program that asks the user for the PIN no more than three times, and does the following: •If the user enters the right number, print...
Many of a bank’s customers use its automatic teller machine to transact business after normal banking...
Many of a bank’s customers use its automatic teller machine to transact business after normal banking hours. During the early evening hours in the summer months, customers arrive at a certain location at the rate of one every other minute. This can be modeled using a Poisson distribution. Each customer spends an average of 99 seconds completing his or her transactions. Transaction time is exponentially distributed. a. Determine the average time customers spend at the machine, including waiting in line...
Code C++ language description about Automated teller machine that can check balance, Deposit and Withdraw money
Code C++ language description about Automated teller machine that can check balance, Deposit and Withdraw money
how does modern day slavery match or diverge from what your idea of slavery and traditional...
how does modern day slavery match or diverge from what your idea of slavery and traditional notions of slavery? how would you rank slavery in relation to other social problems, including human rights violations? Explain your reasoning. How has globalization influenced the modern day sale and use of slaves? What actions would you suggest taking in response to this phenomenon?
The purpose of this C++ programming assignment is to practice using an array. This problem is...
The purpose of this C++ programming assignment is to practice using an array. This problem is selected from the online contest problem archive, which is used mostly by college students worldwide to challenge their programming ability and to prepare themselves for attending programming contests such as the prestige ACM International Collegiate Programming Contest. For your convenience, I copied the description of the problem below with my note on the I/O and a sample executable. Background The world-known gangster Vito Deadstone...
To gain access to his account, a customer using an automatic teller machine (ATM) must enter...
To gain access to his account, a customer using an automatic teller machine (ATM) must enter a 6-digit code ( 0 to 9). If repetition of the same digit is not allowed (for example, 555561 or 333333), how many possible combinations are there?(The first digit can not be zero) a)151200 b)136080 c)1,000,000 d)900,000
1.Activites involve for tunnel boring machine 2.activites involve for tunnel boring machine for pune metro 3.coasting...
1.Activites involve for tunnel boring machine 2.activites involve for tunnel boring machine for pune metro 3.coasting for tunnel boring machine 4.coasting for tunnel boring machine for pune metro
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT