Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I ' m trying to output a certain number ( 7 0 0 0 ) , but it keeps returning the same number I put
Im trying to output a certain number but it keeps returning the same number I put in Am I missing something or did I not type something correctly? This is the code so far:
class UMLLabDriver
public static void mainString args
Person Bob new PersonBob;
Bob.deposit;
Bob.withdraw;
Bob.deposit;
System.out.printlnBobgetAccountBalance;expecting
class Person
private Account account;
private String name;
private int value;
public PersonString name
this.namename;
public String getName
return name;
public void depositint amt
account new Accountamt;
public void withdrawint amt
account new Accountamt;
public int getAccountBalance
return valueaccount.getValue;
class Account
private int value;
public Accountint value
this.valuevalue;
public Account Account p
valuepvalue;
public int withdrawint amt
value amt;
ifvalue
System.out.printlnEXCESS WITHDRAW ALERT.
You will only withdraw the amount equal to what was left in your account.";
value;
return value;
public int depositint amt
value amt;
return value;
public int getValue
return value;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started