Question: 2D public static void main(String[] args) int balance 1000 int amount-Integer.parseInt(args[1]); 17/argeo.equalo Ignorecase balance withdravamount, balance) 2 else balancereste camouns, balance 3 System.out.println(low Balance: +

 2D public static void main(String[] args) int balance 1000 int amount-Integer.parseInt(args[1]);17/argeo.equalo Ignorecase balance withdravamount, balance) 2 else balancereste camouns, balance 3 System.out.println("low

2D public static void main(String[] args) int balance 1000 int amount-Integer.parseInt(args[1]); 17/argeo.equalo Ignorecase balance withdravamount, balance) 2 else balancereste camouns, balance 3 System.out.println("low Balance: + balance); 4 A public statie in withdraw(int amount, int balance) 2 semount balance song ECEUER balance- else Feturn balances 4 B 10 20 21 publise statse ine deposita (ane amount, ine balance) If amounts) 1 return balance Amount: 2 return balances t1: t2: t3: 14: 3 7 21 public static void main(String[] args) int balanceR1000 int amount-Integer.parseInt(args[1]); 1 10 arga10.gaalo Ignorecase balance withdraw famount, balance) 2 else balanced TREE Camount balance 3 System.out.println(to Balancet". balance) 4 > A public static ine withdraw(int amount, in balance) samount balances. Son Dong return balance-mount) 3 return balanced 4 B 15 16 17 16 29 20 21 public statie in deposita(int amount, in balance) Lamounts) 1 BOGUE balance amount 2 23 24 25 return balance 3 = tl: t2: 13: 14: Q) Analyze the following code and then answer the questions: [Hint: Don not draw a CFG] A) Find the execution trace using the four test cases given. [Hint: A is used for the main() function, B for the withdraw() function, and C for the deposit() function] B) Assume that deposit() function is changed to: (amount>0) return balance+amount : return balance-5; which test case(s) do we need to test the change made in deposit() function? T) (10 Points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!