Question

In: Computer Science

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 a message saying, “Your PIN is correct”, and end the program.

•If the user enters a wrong number, print a message saying, “Your PIN is incorrect” and, if you have asked for the PIN less than three times, ask for it again.

•If the user enters a wrong number three times, print a message saying “Your bank card is blocked” and end the program.

Solutions

Expert Solution

PIN = 1234 # user PIN
attempt = 3 # maximum number of attempts

input_PIN = int (input ("Enter Your PIN : ")) # taking PIN from user
attempt -= 1 # decrement the number of attempts after every input

while (attempt > 0) : # Run the while loop until user enters correct PIN or exceeds maximum attempts
  
if (input_PIN == PIN) : # if PIN is correct then exit from loop
print("Your PIN is correct")
break
  
if (input_PIN != PIN) : # if PIN is incorrect then decrement the number of attempts
print("Your PIN is incorrect")
input_PIN = int (input ("Enter Your PIN : "))
attempt -= 1
  
if (attempt == 0) : # if user exceeds maximum attempts then block the card
print("Your bank card is blocked")


Related Solutions

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,...
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
You will write a program using Python that simulates an Automatic Teller Machine (ATM). For this...
You will write a program using Python that simulates an Automatic Teller Machine (ATM). For this program, your code can have user defined functions (but not required), the program must not call on any external functions or modules to handle any of the input, computational, and output requirements. Requirements: There is a customer with the following credential and can only access the system if the Access Code is correct: • Name: Peter Parker, Access Code: 2222 • When the program...
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...
Consider an automatic bank machine, known as Automatic Teller Machine (ATM), and a customer who wishes...
Consider an automatic bank machine, known as Automatic Teller Machine (ATM), and a customer who wishes to withdraw some cash from his or her banking account. Draw a UML system sequence diagram to represent this use case.
CASE Study: A Report on Global ATM Frauds The Automatic Teller Machine (ATM) was first commercially...
CASE Study: A Report on Global ATM Frauds The Automatic Teller Machine (ATM) was first commercially introduced in the 1960s. By 2005, there were over 1.5 million ATMs installed worldwide. The introduction of the ATM proved to be an important technological development that enabled financial institutions to provide services to their customers in a 24X7 environment. The ATM has enhanced the convenience of customers by enabling them to access their cash wherever required from the nearest ATM. However, as the...
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...
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
E-Teller manufactures ATM machines. Recently the company has begun manufacturing and marketing a machine that can...
E-Teller manufactures ATM machines. Recently the company has begun manufacturing and marketing a machine that can recognize customer fingerprints. Demand for this machine is very strong, and the chief executive officer of E-Teller is considering dropping production of the company’s original model, which relies on bankcards and passwords. This will give the company increased capacity to devote to the new model. Which of the following items are relevant to the CEO’s decision to drop the old model machine? a. The...
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT