import java.io.*;
import java.lang.*;
import java.util.*;
class CustomerInfo
{
public String name = new String();
public String accnNumber =new Sting();
public String accnType = new String();
public float balance = 0.0F;
public float rateOfInterest =0.0F;
public float interest = 0.0F;
public float useBalance = 0.0F;
public String password = new String();
void input()
throws IOException
{
System.out.println("Please Enter information");
System.out.print("Enter Name :");
DataInputStream input = new DataInputStream(System.in);
name = input.readLine();
System.out.println();
System.out.print("Enter Account Number : ");
accnNumber = input.readLine();
System.out.println();
System.out.print("Enter Balance: Rs.");
balance = Float.parseFloat(input.readLine());
System.out.println();
System.out.print("Assign a password that you can remember");
password = input.readLine();
System.out.println();
}
}
class Transactions extends CustomerInfo
{
float wthdrw = 0.0F;
float dpst = 0.0F;
void withdraw()
throws IOException
{
DataInputStream input = new DataInputStream(System.in);
System.out.println("You current opening balance is Rs." + useBalance);
System.out.print("Enter the amount to withdraw : Rs.");
wthdrw = Float.parseFloat(input.readLine());
System.out.println();
useBalance-= wthdrw;
System.out.println("The closing balance after withdrawal is Rs." + useBalance);
}
void deposit()
throws IOException
{
DataInputStream input = new DataInputStream(System.in);
System.out.print("Enter the amount to deposit : Rs.");
dpst=Float.parseFloat(input.readLine());
useBalance+= dpst;
System.out.println();
System.out.println("The closing balance after this deposit is Rs."+ useBalance);
}
void calcInterest(float useBalance,float rateOfInterest, boolean ans)
throws IOException
{
interest = (useBalance*rateOfIntrest)/100;
System.out.print("Interest per month is Rs"+interest);
System.out.print("Do you want to see the current usable balance when added to yearly income?Y/N");
if((input.read())=='Y')
ans = true;
if(ans==true)
System.out.println("The amount after one annum will become Rs."+(useBalance+(12*interest)));
else
System.out.println("Thank you");
}
}
class SavingsAccount extends Transaction
{
public SavingsAccount()
{
final float minBalance = 5000;
useBalance = balance-minBalance;
accnType = "Savings";
rateOfInterest1 = 10;
}
void actions()
throws IOException
{
DataInputStream input = new DataInputStream(System.in);
SavingsAccount sAccount[]=new SavingsAccount[1000];
do
{
System.out.println("What do want to do?");
System.out.println("1.Withdraw");
System.out.println("2.Deposit");
i=1;
SavingsAccount sAccount[i]=new SavingsAccount();
if((input.read())=='1')
sAccount[i].withdraw();
else if((input.read())=='2')
sAccount[i].deposit();
}while((input.read())!='1'||(input.read())!='2');
System.out.println("Do you want to see the interest?Y/N");
if((input.read())=='Y')
sAccount[i].calcInterest(useBalance,rateOfInterest,true);
else
System.out.println("Thank you.");
}
}
class CurrentAccount extends Transaction
{
public CurrentAccount()
{
final float minBalance2 = 3000;
useBalance = balance-minBalance2;
accnType = "Current";
rateOfInterest2 = 2;
}
void actions()
throws IOException
{
DataInputStream input = new DataInputStream(System.in);
do
{
System.out.println("What do want to do?");
System.out.println("1.Withdraw");
System.out.println("2.Deposit");
if((input.readLine())==1)
cAccount[j].withdraw();
else if((input.readLine())==2)
cAccount[j].deposit();
}while((input.read())!='1'||(input.read())!='2');
System.out.println("Do you want to see the interest?Y/N");
if((input.read())=='Y')
cAccount[j].calcInterest(useBalance,rateOfInterest2,true);
else
System.out.println("Thank you.");
}
}
class BankHQ
{
public static void main(String args[])
throws IOException
{
SavingsAccount sAccount[] = new SavingsAccount[1000];
CurrentAccount cAccount[] = new CurrentAccount[1000];
byte i = 1,j = 1;
do
{
do
{
System.out.println("Start filling values. Enter account type");
if((input.readLine())=="Savings")
{
SavingsAccount sAccount[i];
sAccount[i] = new SavingsAccount();
sAccount[i].input();
i++;
for(int k=1;k<20;k++)
System.out.println();
}
else if((input.readLine())=="Current")
{
CurrentAccount cAccount[j]=new CurrentAccount();
cAccount[j].input();
j++;
for(int k=1;k<20;k++)
System.out.println();
}
else
System.out.println("Invalid Entry");
}while((input.readLine())!="Savings"||(input.readLine())!="Current");
System.out.println("Do you want to enter more account information?Y/N");
if((input.readLine())=="Y")
ans=true;
}while(ans==true);
}
}
In the above code, I seem to get six errors, three ']' expected and the three ';' expected. One of the lines is line 102... please check and tell me an amendment?