Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is the code I have so far, but can't get my output to look like the example any help is grately appreciated. CSE 110

image text in transcribed

image text in transcribed

image text in transcribed

This is the code I have so far, but can't get my output to look like the example any help is grately appreciated.

CSE 110 Assignment 5 BankAccount Class 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 BankAccount Steps to update your BankAccount class private int acctNumber private double balance private String name o Define all the instance variables Create constructor methods so that all instance variables are initialized o Add mutator (setters) and accessor (getters) methods for appropriate instance variables o public BankAccount() public void setAcctNumber(int acct) public void setName(String owner) Add any other methods defined in the UML diagram o o Update the toString method to return the current state of all instance variables public int getAcctNumber public double getBalance() public String getName() public void deposit(double amount) public void withdraw(double amount) public String toString) Create the tester class called Bank to test. //create a BankAccount object called studentAcct //studentAcct should be owned by Sue Student //studentAcct account number should be 1234 //display the state of object studentAcct //deposit 200.00 in studentAcct //withdraw 30.00 from studentAcct /Idisplay the balance in studentAcct /Idisplay the state of object myAcct //display the state of object studentAcct The output from running Bank should be as follow:s 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_2

Step: 3

blur-text-image_3

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

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

=+and non-compete agreements in three to five different countries.

Answered: 1 week ago