Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
