Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need codes for these 2 files. Thanks! Please review the corresponding informal UML class diagram for the BankAccount class. Create all of the methods

image text in transcribedI need codes for these 2 files. Thanks!

Please review the corresponding informal UML class diagram for the BankAccount class. Create all of the methods that is shown in the UML for your class. You must name your variables and methods as indicated. You will be turning in two java files Bank.java and BankAccount.java. Steps to update your BankAccount class: int acctNumber o Define all the instance variables o Create constructor methods so that all private double balance String name instance variables are initialized. o Add mutator (setters) and accessor (getters) methods for appropriate instance variables. Add any other methods defined in the UML diagram. Update the toString method to return the o blic void setAcctNumber(int acct) blic void setName(String owner) blic Int getAcctNumber) blic String getName lic void deposit double amount) public void setBalancoldouble amount) o current state of all instance variables public double getBalance) ic void withdraw(double amount) blic String toStringt Create the tester class called Bank to test //create a BankAccount object called studentAcct /tudentAcct shouid be owned by Sue Student /tud@ntAect ccount nuaber #hould bo 1.234 //dinplay the state of object #tudentAcct //deposit 200.00 in studentAcct //withdraw 30.00 fron ntudentAcct Idinplay the balance in ntudentAcct dinplay the state of object myAcct //dinplay the state of object studentAcct The output from running Bank should be as follows: Welcome to our Bank Beginning state of myAcct: acctNumber: 0 balance: $0.00 name: Unknown The balance of myAcct after deposit is:100.0 State of myAcct after deposit and withdraw: acctNumber: 0 balance: $75.00 name: Unknown State of studentAcct: acctNumber: 1234 balance: $0.00 name: Sue Student The balance of studentAcct after deposit/withdraw is 170.0 State of myAcct: acctNumber: 0 balance: $75.00 name : Unknown State of studentAcct: acctNumber: 1234 balance: $170.00 name : Sue Student

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

Students also viewed these Databases questions