Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++ please. Write a C++ program that simulates an ATM machine. Assume that you have a bank balance of $1000 at the Bank. Write
In C++ please.
Write a C++ program that simulates an ATM machine. Assume that you have a bank balance of $1000 at the Bank. Write a C++ program that allows you to withdraw money from your account by entering your PIN number and the amount you would like to withdraw. The program should work as follows: If the user enters the wrong PIN number, display a message that says, "Wrong PIN, please re-enter your PIN number" and ask them for the PIN again. After three incorrect tries, the program should quit with the message "Wrong PIN, too many tries, your account has been locked". If the user enters the correct PIN, ask the user for the amount of money to withdraw. The user should not be allowed to request more money than their balance amount. Display a message indicating their new balance and quit the program. Display all dollar amounts in fixed format with two decimal places. Sample run (assuming the balance is $1000.00 and the PIN is 1234): ./a.out Welcome to the Bank ATM machine Enter the PIN number: 1000 Wrong PIN, please re-enter your PIN You have 2 tries left Enter the PIN number: 2345 Wrong PIN, please re-enter your PIN You have 1 tries left Enter the PIN number: 4567 Too many tries, your account has been locked ./a.out Welcome to the Bank ATM machine Enter the PIN number: 1234 Enter the amount you wish to withdraw: 5000.00 You do not have enough funds, please try again ./a.out Welcome to the Bank ATM machine Enter the PIN number: 1234 Enter the amount you wish to withdraw: 450.00 Your current balance is $550.00Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started