Answered step by step
Verified Expert Solution
Question
1 Approved Answer
mport is used at the top of python files to include packages or modules. We will import os which stands for operating system. We will
mport is used at the top of python files to include packages or modules. We will import
os which stands for operating system. We will use this package to clear our
consoleterminal screen. Add this code after your comment: import os
Declare object variables
Declare an object for each test data item listed above and assign the starting values to
each object. Ensure you specify the correct Types. The pin will be a string so we can
avoid an extra line of code to convert the entered string to an int. Dont forget so
account is a float versus an int.
account will hold a float which will be the amount of money the user has access
to They will be able to withdraw or deposit money frominto this account.
pin, a string the length of characters used to authenticate the correct user is
accessing the account. More security would be added later, but this is a simple test.
tries and maxtries will be used to track the number of pin entries. If the user
incorrectly enters bad pin values, the program will exit stating they are Locked
out!
Main application loop, create a while loop that continues to execute while tries is less
than maxTries. Tries will start at Any time a user successfully enters the correct pin tries
will be reset back to so that when the user returns to the main menu, they get new
attempts to enter the correct pin. Use the below format:
while expression :
You must indent any lines of code that are to be within the loop. This is required.
Build a main menu by printing the bank logo Cactus Bank as the first linen in
console window. The logo will take up spaces and be centered on the screen.
Make use of string formatting and columns. The carat will center and is the
number of spaces the placeholder value Cactus Bank will take up on the line.
Prompt user for input. The prompt should state, Enter pin or x to exit the
Step 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