Question
Assignment 1: Object-oriented programming: Creating a Bank Account Class Create a Python class called BankAccount that represents a simple bank account. The class should have
Assignment 1: Object-oriented programming: Creating a Bank Account Class Create a Python class called BankAccount that represents a simple bank account. The class should have the following attributes: account_number: a string representing the account number. balance: a float representing the current balance of the account. owner_name: a string representing the name of the account owner. The class should also have the following methods: deposit(amount): a method that takes in a float representing the amount to be deposited and adds it to the current balance. The method should return the new balance. withdraw(amount): a method that takes in a float representing the amount to be withdrawn and subtracts it from the current balance. The method should return the new balance. get_balance(): a method that returns the current balance. get_account_number(): a method that returns the account number. get_owner_name(): a method that returns the account owner's name. 2. call the deposit method and deposit 500, and print all attributes as per the final output a. Deposit amount b. owener_name = your name c. account_balance = 1000 d. account_number = your student id
PLEASE USE PYTHON
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