Question: Java!!!!! Plz help!!! Q1: Q2: Q3: ' Tester BankAccount.java public class Tester i public static void main(String[] args) { BankAccount myBankAccount = new BankAccount(): myBankAccount.

Java!!!!! Plz help!!!

Java!!!!! Plz help!!! Q1: Q2: Q3: ' Tester BankAccount.java public class Tester

i public static void main(String[] args) { BankAccount myBankAccount = new BankAccount():myBankAccount. deposit(500): myBankAccount. withdraw (260): double result = myBankAccount.getBalance(): } } What

Q1:

is the final value of result? Submit Tester Point.java public class Tester

i public static void main(String[] args) { Point p = new Point();

Q2: D. set1 (7): int result = p.getX() + p.getY(): } } WhatQ3:

is the final value of result? Submit Tester Cash Register.java public class'

Tester i public static void main(String[] args) { CashRegister register = new

Tester BankAccount.java public class Tester i public static void main(String[] args) { BankAccount myBankAccount = new BankAccount(): myBankAccount. deposit(500): myBankAccount. withdraw (260): double result = myBankAccount.getBalance(): } } What is the final value of result? Submit Tester Point.java public class Tester i public static void main(String[] args) { Point p = new Point(); D. set1 (7): int result = p.getX() + p.getY(): } } What is the final value of result? Submit Tester Cash Register.java public class Tester i public static void main(String[] args) { CashRegister register = new CashRegister(): register. recordPurchase (0.75): register.recordPurchase (2.50): register.enterPayment (5, 0,5, 0, 0); double result - register. giveChange(): } } What is the final value of result? Submit Tester BankAccount.java A bank account has a balance that can be changed by deposits and withdrawals. public class BankAccount { /** Constructs a bank account with a zero balance. public BankAccount() { balance = 0; } Constructs a bank account with a given balance. @param initialBalance the initial balance public BankAccount (double initialBalance) { balance - initialBalance: } /** Deposits money into the bank account. @param amount the amount to deposit public void deposit (double amount) { double newBalance = balance + amount: balance = newBalance: } /** Withdraws money from the bank account. @param amount the amount to withdraw /** Withdraws money from the bank account. @param amount the amount to withdraw public void withdraw(double amount) { double newBalance = balance amount balance = newBalance: } /** Gets the current balance of the bank account. @return the current balance public double getBalance() { Tester Point.java public class Point 1 private int x = 0: private int y = 0; public Point () { x = 0 y = 0; } //constructor public Point (int a, int b) { X = a: y = b; } public void setX(int a) { } public int getX() { return x; } public int getY() { return y } } Tester Cash Register.java A cash register totals up sales and computes change due. public class CashRegister { Constructs a cash register with no money in it. public CashRegister() { purchase 0: payment = 0; } /** Records the sale of an item. @param amount the price of the item public void recordPurchase (double amount) { double total = purchase + amount; purchase = total: } Enters the payment received fro customer. @param amount the amount of the payment public void enterPayment (double amount) { payment = amount: } Enters the payment received from the customer. @param dollars the number of dollars in the payment @param quarters the number of quarters in the payment @param dimes the number of dimes in the payment @param nickels the number of nickels in the payment @param pennies the number of pennies in the payment public void enterPayment (int dollars, int quarters, int dimes, int nickels, int pennies) { payment = dollars + quarters * QUARTER_VALUE + dimes * DIME_VALUE + nickels * NICKEL_VALUE + pennies * PENNY_VALUE : Computes the change due and resets the machine for the next customer. @return the change due to the customer public double giveChange() purchase: = double change = payment purchase 0; Payment = 0; return change: } public static final double QUARTER_VALUE = 0.25 : public static final double DIME_VALUE = 0.1; public static final double NICKEL_VALUE = 0.05; public static final double PENNY_VALUE = 0.01; private double purchase: private double payment: }

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!