Design a class called Account CLASS NAME:    Account ATTRIBUTES: -nextAcctID: int    #NOTE- class-level attribute initialized to 1000 -acctID: int -bank: String -acctType: String  (ex: checking, savings) -balance: Float METHODS: <>Account( bank: String, type:String, bal:float) +getAcctID(void): int                        NOTE:  retrieving a CLASS-LEVEL attribute! -setAcctID(newID: int): void           NOTE:  PRIVATE method +getBank(void): String +setBank(newBank: String): void +getBalance(void): float +setBalance(newBal: float): void +str(void): String  NOTE: Description:  prints the information for the account one item per line. For example: Account #:          100 Bank:                    NorWest Account Type:    Checking Balance:              $150.98 +calcInterest(type):float                NOTE:  checking 1% get interest,  savings  get 2% interest.  Updates balance!   Version 1 of the Account class:  private data is a list that stores the account number, bank name, account type, and balance. Version2 of the Account class: private data is stored as separate variables. OPTIONAL BONUS + 5:  Version 3 of the Account class: private data is stored as a tuple that stores the account number, bank name, account type, and balance. Create a test program that works with all versions of the Account class, regardless of the way the private data was stored in the class.       LABEL all output, and be SURE to test EVERY method! Suggestion: Create separate modules for each of the different versions of the Account class.  Be sure that the class itself is always called Account in each of the modules – only the module name should change.Your testing should provide the SAME code for ALL versions, except that you’ll use a different import statement for each.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

             This is a python Class

Design a class called Account

CLASS NAME:

   Account

ATTRIBUTES:

-nextAcctID: int    #NOTE- class-level attribute initialized to 1000

-acctID: int
-bank: String
-acctType: String  (ex: checking, savings)
-balance: Float

METHODS:

<<Constructor>>Account( bank: String, type:String, bal:float)
+getAcctID(void): int                        NOTE:  retrieving a CLASS-LEVEL attribute!
-setAcctID(newID: int): void           NOTE:  PRIVATE method
+getBank(void): String
+setBank(newBank: String): void

+getBalance(void): float
+setBalance(newBal: float): void

+str(void): String

 NOTE: Description:  prints the information for the account one item per line. For example:
Account #:          100
Bank:                    NorWest
Account Type:    Checking
Balance:              $150.98

+calcInterest(type):float
               NOTE:  checking 1% get interest,  savings  get 2% interest.  Updates balance!

 

Version 1 of the Account class:  private data is a list that stores the account number, bank name, account type, and balance.

Version2 of the Account class: private data is stored as separate variables.

OPTIONAL BONUS + 5:  Version 3 of the Account class: private data is stored as a tuple that stores the account number, bank name, account type, and balance.

Create a test program that works with all versions of the Account class, regardless of the way the private data was stored in the class.       LABEL all output, and be SURE to test EVERY method!

Suggestion:

Create separate modules for each of the different versions of the Account class.
 Be sure that the class itself is always called Account in each of the modules – only the module name should change.Your testing should provide the SAME code for ALL versions, except that you’ll use a different import statement for each.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 8 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education