Part A) You will write a new concrete class: Credit Card which is also a subclass of BankAccount. Credit Card class' UML
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Part A) You will write a new concrete class: Credit Card which is also a subclass of BankAccount. Credit Card class' UML
Part A) You will write a new concrete class: Credit Card which is also a subclass of BankAccount. Credit Card class' UML diagram is given below. Credit Card -creditLimit:int +CreditCard(balance:int,interestRate:double, account Number:String, creditLimit: int) +getCreditLimit():int +setCreditLimit(fee:int):void +deposit(amount:int): int +withdraw(amount:int): int +applyinterest(): void +getInfo(): String 0 O O . The constructor calls super and also initializes the creditLimit. deposit method: adds the given amount to balance returns the balance. withdraw method: decrements the balance with respect to given amount calls applyinterest emthod returns balance applyinterest method calculate the new balance as: balance-=(balance*interestRate) O O O O
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!