0

I am getting this error message please help me solve it

F:\JAVA\Java Files\lab 9\MyCustomer.java:19: ';' expected
			account deposit(500.0);
			               ^
F:\JAVA\Java Files\lab 9\MyCustomer.java:26: ';' expected
		cust2  addAccount(account);
		                 ^
F:\JAVA\Java Files\lab 9\MyCustomer.java:26: not a statement
		cust2  addAccount(account);
		                  ^
F:\JAVA\Java Files\lab 9\MyCustomer.java:26: ';' expected
		cust2  addAccount(account);
		                         ^
 F:\JAVA\Java Files\lab 9\MyCustomer.java:27: ';' expected
 		cust1  addAccount(account);            // a joint account for jack/debie
		                 ^
F:\JAVA\Java Files\lab 9\MyCustomer.java:27: not a statement
		cust1  addAccount(account);            // a joint account for jack/debie
		                  ^
F:\JAVA\Java Files\lab 9\MyCustomer.java:27: ';' expected
		cust1  addAccount(account);            // a joint account for jack/debie

this is the java source file which the error is referring to

public class MyCustomer
{
	public static void main (String[] args)
	{
		Customer cust1, cust2, cust3;
		Account account;

		cust1 = new Customer("Debbie gralla");
		account = new CheckingAccount(5000.0, 200.0);  //accountNo = 1
		cust1.addAccount(account);
		cust1.addAccount(new Savingsaccount(5000.0,0.05));  //saving accountNo= 2
		cust1.addAccount(new CheckingAccount(200.0,0));  //saving accountNo =3

		acccount = cust1.getAccount(2);   //retrieve Debie savings account
		if (account != null)
		{
			account deposit(500.0);
		}

		cust1.getAccount(1); withdraw(200.0);

		cust2 = new Customer("Jack leu");
		account = new CheckingAccount(500.0,20000.0);   //accountno =4
		cust2  addAccount(account);
		cust1  addAccount(account);            // a joint account for jack/debie

		cust1.getAccount(4); withdraw(20000.0);

		cust3 = new Customer("Jill bye");
		account = new CheckingAccount(755.0,210000.0);   //accountno =5
		cust3.addAccount(account);
		cust3.addAccount(new Savingsaccount(51070.0,0.04));  //saving accountNo= 3
	    cust3.addAccount(new CheckingAccount(755.0,210000.0));  //saving accountNo =4
        cust3.getAccount(5); deposit(1000.0);
		cust3.getAccount(5); withdraw(2450.0);
    }
}
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ezzaral
0

It clearly says "not a statement". You need "."s between the object reference and methods to make those valid.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.