Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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. 110Step 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