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.
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 |
METHODS: <<Constructor>>Account( bank: String, type:String, bal:float) +getBalance(void): float +str(void): String NOTE: Description: prints the information for the account one item per line. For example: +calcInterest(type):float |
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.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 8 images