Question: Java What is the value of finalAmount after executing the following code? ( Assume each class is defined in a separate java file). 2 3

 Java What is the value of finalAmount after executing the following

Java

What is the value of finalAmount after executing the following code? ( Assume each class is defined in a separate java file). 2 3 4 public class Midterml { private String cashierName; private double initialBalance; private String transactionNum; 6 8 19 10 public void setinitialBalance (double inBalance) { initialBalance = inBalance; } 12 13 public double getinitialBalance () { return initialBalance; } 15 17 18 public void addBonus (double bonusPer, double amount) { initialBalance += initialBalance * bonusPer + amount; } 19 } 120 21 public class MidTermlTest { 122 public static void main (String [] args) MidTerml cr = new MidTerml(); 23 24 25 26 27 28 129 30 31 32 33 34 cr.setinitialBalance (200); cr.addBonus (.3, 10); double finalAmount = cr.getinitialBalance () + 150; A. 420 B. 410 O C. 130 OD. 110

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!