Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

Python Class and Objects

  1. Create a class named "Account" and “Bank”
  2. The class “Account” should have a parameter of 

id   - integer type

name - string type

balance - float type

# (Optional) You may add more parameters for your convenience

   

3. Create a method for “Account” class

checkBalance(self)    -  this will show the Account's remaining balance or money

withdraw(self, amount)   - this will withdraw an amount from the Account

deposit(self, amount) - this will deposit an amount from the Account

# (Optional) You may add more methods like sendMoney() etc.

   

4. Create a method for “Bank” class:

addAccount(self, account) – used to register an account to the bank

# (Optional) You may add more methods for your convenience

   

4. Create 3 Account objects with the following attributes in the main method

account1 - id=(any number), name=(Any Name You Want), balance=7000 (strictly use this value)

account2 - id=(any number), name=(Any Name You Want), balance= (any amount)

account3 - id=12, name= Jose Rizal , balance= 25000        !(use these values for account3)

# (Optional) You may add more objects if you want.

   

5. In the main method. Write a program that will act as an ATM.

The ATM will prompt for account ID

A menu for check balance, deposit, withdraw and exit shall display

 

 6. Test your program with the following scenario:

Output 1:

Use Account 1

Check Balance

Withdraw 2000

Exit (End Transaction) program will prompt another user id

 

Output 2:

Use Account 2

Deposit an amount of 500

Exit (End Transaction) program will prompt another user id

Use Account 3

Check Balance

Exit (End Transaction) program will prompt another user id

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY