Answered step by step
Verified Expert Solution
Link Copied!

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
console/terminal screen. Add this code after your comment: import os
2. 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 .00 so
account is a float versus an int.
2.1. 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 from/into this account.
2.2. pin, a string the length of 4 characters used to authenticate the correct user is
accessing the account. More security would be added later, but this is a simple test.
2.3. tries and max_tries will be used to track the number of pin entries. If the user
incorrectly enters 3 bad pin values, the program will exit stating they are Locked
out!.
3. Main application loop, create a while loop that continues to execute while tries is less
than maxTries. Tries will start at 1. Any time a user successfully enters the correct pin tries
will be reset back to 1 so that when the user returns to the main menu, they get 3 new
attempts to enter the correct pin. Use the below format:
while expression :
You must indent any line(s) of code that are to be within the loop. This is required.
3.1. Build a main menu by printing the bank logo Cactus Bank as the first linen in
console window. The logo will take up 30 spaces and be centered on the screen.
Make use of string formatting and columns. The carat ^ will center and 30 is the
number of spaces the placeholder value Cactus Bank will take up on the line.
3.2. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions