Question: in java please I need this as soon as u can . Thanks Given the following code: public class Account private double balance; // instance

in java please I need this as soon as u can . Thanks  in java please I need this as soon as u can
. Thanks Given the following code: public class Account private double balance;

Given the following code: public class Account private double balance; // instance variable that stores the balance H constructor public Account ( double initialBalance ) { 77 validate that initial Balance is greater than 0.8; 7/ if it is not, balance is initialized to the default value 0.8 if ( initialBalance > 0.0 ) balance initialBalance; 1 Nend Account constructor W credit (add) an amount to he account public void credit( double amount) { balance = balance + amount; // add amount to balance } // end method credit // return the account balance public double getBalance() { return balance; // gives the value of balance to the calling method } // end method getBalance } // end class Account What is output by the following main method? public static void main(String args[]) { Account account1 = new Account( -20.17), System.out.printf("account balance: $%.2f ", account1.getBalance()); } // end main What is output by the following main method? public static void main(String args[]) { Account account1 = new Account( 20.17 ); System.out.printf( "account1 balance: $%.2f ", accountl.getBalance()); end main o account balance: 20 e account balance: 20.17 o account balance: is -20.17 o account1 balance: 0.0

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!