Question: Public class BankAccount { private double balance; private String name; private int acctNumber; public BankAccount (String initName , int acct ) { name=initName; acctNumber=acct; balance=0.0;

Public class BankAccount {

private double balance; private String name; private int acctNumber;

public BankAccount (String initName , int acct ) { name=initName; acctNumber=acct; balance=0.0; }

public void deposit(double amt) { balance=balance+amt; }

public void withdraw(double amt) { balance=balance-amt; }

public double getBalance() { return balance; }

}

public class BankTester { // identifier public static void main(String args[]);

//create bank account BankAccount bat = new BankAccount(); //deposit the 1000 bat.deposite(1000); //print the balance bat.print(); //withdraw the 500 bat.widthdraw(500); bat.print();

//widthdraw(400); bat.widthdraw(400);

bat.print();

}

Can Someone help with the error i get this in terminal.

"/BankTester.java:1: error: class, interface, enum, or record expected Public class BankAccount { ^ /BankTester.java:39: error: expected bat.deposite(1000); ^ /BankTester.java:39: error: illegal start of type bat.deposite(1000); ^ /BankTester.java:41: error: expected bat.print(); ^ /BankTester.java:43: error: expected bat.widthdraw(500); ^ /BankTester.java:43: error: illegal start of type bat.widthdraw(500); ^ /BankTester.java:44: error: expected bat.print(); ^ /BankTester.java:47: error: expected bat.widthdraw(400); ^ /BankTester.java:47: error: illegal start of type bat.widthdraw(400); ^ /BankTester.java:49: error: expected bat.print(); ^ 10 errors"

how can i fix this. thank you . If you cannot provide a solution dont answer thanks

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!