So I wrote this program for a lab assignment and I tried to compile it and I got this syntax error - "1 error found: File: C:\Users\Documents\Unit6myName.java [line: 34] Error: Syntax error on token "else", ) expected" Could anyone help me out with this?
import java.util.*; public class Unit6MYNAME { public static final double SAVE_INTEREST = .04; public static final double NORM_CHECK_INTEREST = .015; public static final double MAX_CHECK_INTEREST = .03; public static final double CHECK_FEE = 25.00; public static final double SAVE_FEE = 10.00; public static final double CHECK_MINI_BAL = 25.00; public static final double SAVE_MINI_BAL = 500.00; public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String accountNumber, accountType, continuation; double preAccountBalance, accountBalance, interest; while (continuation.equalsIgnoreCase("y")) { System.out.println("Please enter y to continue, "); System.out.println("otherwise enter n to quit."); continuation = keyboard.nextString; if (accountNumber.matches("\\d{10}") else System.out.println("Invalid Entry"); System.exit(0); System.out.println("Please enter the letter c to enter information"); System.out.println(" for a checking account."); System.out.println("Otherwise, enter s for a savings account."); accountType = keyboard.nextLine; if (accountType.equalsIgnoreCase("c")) { System.out.println("Please enter the account balance."); preAccountBalance = keyboard.nextDouble; if (preAccountBalance < CHECK_MINI_BAL) { preAccountBalance = preAccountBalance - CHECK_FEE; interest = 0; } else interest = preAccountBalance * NORM_CHECK_INTEREST; accountBalance = preAccountBalance + interest; } else if (accountBalance >= 5500) interest = preAccountBalance * MAX_CHECK_INTEREST; accountBalance = preAccountBalance + interest; System.out.println("Account Number:" + accountNumber); System.out.println("Type of Account:" + accountType); System.out.printf("Previous Balance: .2f" , preAccountBalance); System.out.printf("Interest Earned: .2f" , interest); if (preAccountBalance < CHECK_MINI_BAL) System.out.printf("Service Fee: .2f" , CHECK_FEE); System.out.println("New Balance: .2f" , accountBalance); } if (accountType.equalsIgnoreCase("s")) { System.out.println("Please enter the account balance."); accountBalance = keyboard.nextDouble; if (preAccountBalance < SAVE_MINI_BAL) { preAccountBalance = accountBalance - SAVE_FEE; interest = 0; } else interest = preAccountBalance * SAVE_INTEREST; accountBalance = preAccountBalance + interest; System.out.println("Account Number:" + accountNumber); System.out.println("Type of Account:" + accountType); System.out.printf("Previous Balance: .2f" , preAccountBalance); System.out.printf("Interest Earned: .2f" , interest); if (preAccountBalance < SAVE_MINI_BAL) System.out.printf("Service Fee: .2f" , CHECK_FEE); System.out.println("New Balance: .2f" , accountBalance); } } }