Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions