Part A) Please check the given UML diagrams carefully and implement their corresponding Java classes. Notice that abstra

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Part A) Please check the given UML diagrams carefully and implement their corresponding Java classes. Notice that abstra

Post by answerhappygod »

Part A Please Check The Given Uml Diagrams Carefully And Implement Their Corresponding Java Classes Notice That Abstra 1
Part A Please Check The Given Uml Diagrams Carefully And Implement Their Corresponding Java Classes Notice That Abstra 1 (117.6 KiB) Viewed 59 times
Part A) Please check the given UML diagrams carefully and implement their corresponding Java classes. Notice that abstract classes' names and methods are italicized in UML. <<abstract>> keyword can also be used before the class name for a more explicit information. Other than setters and getters, necessary implementation information are given after the diagrams. <cabstract >> BankAccount #balance: int #interestRate: double #account Number: String +BankAccount balance in interestRate:double account Number:String) getAccount Number -String tsetAccount Numberinumber:String) vold getBalance()sint getinterestRate():double #setInterestRate(rate:double avoid +depositamountaint): int -withdrow/amount intrint opplyinterest(): void get infoll: String Checking Savings -overdraftFint account NumberString. +Checking balancerint,interestRate:double, overdraftFee:int) +getFeelint setFeelfee:int):void +depositfamount:intint withdrawlamount int): int applyinterest:void getinfo): String +Savings balance int, interestRate:double, account Number:String) +deposit(amount:int: int +withdrawamount:Inty: int +applyinterest():void +getinfo: String . Savings constructor simply calls the super constructor. Checking constructor calls super and also initializes the overdraftFee. Both getInfo methods creates a String which has the type and balance information (see sample output) and returns it. . Checking deposit method: o adds the given amount to balance o checks the current day of the date (e.g. for today (4/5/2022), day is: 5 - use a date API, no hardcode). If day is greater than 27, calls applyInterest method. o returns the balance. . Checking withdraw method: o if balance is less than 0 . decrements the balance with respect to (given amount+overdraftFee) o otherwise • decrements the balance with respect to given amount only o returns balance Checking applyinterest method o calculate the new balance as: balance+=(balance interestRate) Savings deposit method: o adds the given amount to balance o calls applyinterest method o returns the balance. Savings withdraw method: o decrements the balance with respect to the given amount calls applyinterest method o returns the balance. Savings applyinterest method o calculate the new balance as: balance+=(balance*2*interestRate) o : 2 o Part B) Create a driver class, namely BankTest. In this class: create 4 BankAccount objects, where 2 of them are Checking (C)and 2 of them are Savings (S) 4 , 2 ) accounts (here is an example for you - balance, interestRate, accountnumber and for Checking only, overdraftFee, in order): o C-1: 10000, 0.02, "AC785689", 5 o C-2: 15000, 0.02, "AC123899", 5 o S-1: 100000, 0.03, "AS785689" o S-2: 1250000, 0.04, "AS345678" create an arraylist to keep these 4 objects. ask the user to enter the customer account number • find the corresponding account from the list and keep it • show banking options to the user (see sample output) call corresponding method for that object according to the user choice (i.e. deposit, withdraw or printinfo) Ask if the user wants to continue with this account and show the options if so If the user wants to continue with another account, start from the beginning If the user wants to exit completely, exit Print today's date (automatic - no hardcode) and thank you message
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply