Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLE HElP ME BY PYTHON HELP ME PYTHON!! In this project, you will write two files: a class that represents a bank account and a

PLE HElP ME BY PYTHON

image text in transcribed

image text in transcribed

HELP ME PYTHON!!

In this project, you will write two files: a class that represents a bank account and a program that works ike an ATM for bank accounts. The Bank Account Class In a file named account.py, create an Account class. An account object has these attributes: acct_number : the account number (an integer) name : the account holder's name pin : the account holder's PIN, which is a four-character string, since it can have leading zeros. balance : the current balance in the account, which is a float. Implement these methods: _init_(self, acct_number, name, pin, balance) The constructor str_(self) Returns a string giving the account ID, name, PIN, and balance, separated by colons. Do not use format() on the balance; you want to keep the number as accurate as possible. deposit(self, amount) Adds the given amount (a float ) to the current balance. If the amount is negative, the balance must not be changed; otherwise, the balance attribute is updated to reflect the deposit. This method returns the updated balance. withdraw(self, amount) Withdraws the given amount (a float ) from the current balance. If the amount is negative or greater than the current balance, the balance must not be changed; otherwise, the balance attribute is updated to reflect the withdrawal. This method returns the updated balance. Note that deposit() and withdraw() do not print error messages if they get incorrect input; they simply ignore it. It is up to the program that calls these functions to provide the error messages for the user of the program. Sample Output Here is what your program output might look like: Enter account number (or ENTER to quit): 12345 Invalid account number. Enter account number (or ENTER to quit): 10626 Enter a 4-digit PIN: 1111 Enter a 4-digit PIN: 2222 Enter a 4-digit PIN: 3333 Sorry, could not validate you as a customer. Enter account number (or ENTER to quit): 10626 Enter a 4-digit PIN: 6717 Welcome, Roz Chast! Your current balance is $1853.22. D)eposit, W)ithdraw, or F)inish: d Enter amount to deposit: $-5 Amount cannot be negative. Enter amount to deposit: $1000 Your balance is now $2853.22 D) eposit, W)ithdraw, or F)inish: w Enter amount to withdraw: $2870 Amount cannot be negative or greater than balance. Enter amount to withdraw: $500.11 Your balance is now $2353.11 D)eposit, W)ithdraw, or F)inish: f Thank you for banking with us, Roz Chast

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

Explain the functions of financial management.

Answered: 1 week ago

Question

HOW MANY TOTAL WORLD WAR?

Answered: 1 week ago

Question

Discuss the scope of financial management.

Answered: 1 week ago

Question

Discuss the goals of financial management.

Answered: 1 week ago

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago

Question

1. Who should participate and how will participants be recruited?

Answered: 1 week ago