Tuesday, June 19, 2012

When we do not put semicolon at the end of the java statement?

When any statement is followed by any curley('{') braces then that statement must not end with semicolon(;).
For example:- class name or any function name must not end with semicolon. Similarly any looping statement, switch , if or else statement must not end with semicolon.


Tuesday, June 5, 2012

63 students got 90% and above in computer application under my teaching this year in icse- 2012 exam. and 17 students out of 28 got above 90% and rest got 80% and above in ISC-2012 exam. in computer science.


Friday, June 1, 2012

Banking project program for ICSE students (develop in bluej java)


import java.io.* ;
class banking
{
public void display() throws IOException
{
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
System.out.println ("WELCOME TO STATE BANK OF INDIA ");
String a[]= new String[100];
System.out.println("Enter your name:");
for (int k=0;k<100;k++)
{
a[k]=r.readLine();


int ac[]=new int[100];
int Bal[]=new int[100];
for ( k=0;k<100;k++)
{
ac[k]=0;
Bal[k]=0;
}
int x=372;
int i=0,amt=0;
for( i=0;i<=49;i++)
Bal[i]=10000;
System.out.println("The permanent members are :- ");
for(int j=0;j<=49;j++)
{
System.out.println(a[j]+ "has ac no ."+ac[j]);
}
System.out.println("You a permanent member : Y / N ");
String x1=r.readLine();
if(x1.equalsIgnoreCase("Y"))
{
System.out.println("Please enter your accont no.");
int b = Integer.parseInt(r.readLine());
int pos=-1;
for(int j=0;j<=49;j++)
{
if(ac[j]==b);
{
pos=j;
break;
}
}

if(pos!=-1)
{
System.out.println("Your balance is :" + Bal[pos]+ "You can deposit or Withdrawal money : Press 1 for Deposit money and Press 2 for Withdrawal money ");
int c=Integer.parseInt(r.readLine());
if(c==1)
{
System.out.println("Please enter the amt you want to deposit ");
amt=Integer.parseInt(r.readLine());
Bal[pos]=Bal[pos]+amt;
}
else if (c==2)
{
System.out.println("Please enter the amt you want to withdrawal");
amt=Integer.parseInt(r.readLine());
if((Bal[pos]-amt)>1000)
Bal[pos]=Bal[pos]-amt;
else
System.out.println("Warning ! Your balance is "+Bal[pos]+ "and so you cannot withdrawal" +amt+ "as the balance become"+(Bal[pos]-amt)+ "Which is less than Rs.1000 the minimum balance to be kept in this accont ");
}
else
{
System.out.println("You have made wrong entry !!!!!");
System.out.println("Thanking you , Have a good day.");
}
if(x1.equalsIgnoreCase("N"))
{
System.out.println("How many accounts do you want to create");
b=Integer.parseInt(r.readLine());
Bal[i]=amt;
}
System.out.println("Now do you want to Withdraw or Deposit money Y or N ");
String xx=r.readLine();
if(xx.equalsIgnoreCase("Y"))
{
System.out.println ("Press 1 to Deposit and 2 for Withdraw Money ");
int xxx=Integer.parseInt(r.readLine());
System.out.println("Enter your Ac no ");
c = Integer.parseInt(r.readLine());
int pose=-1;
for(int j=50;j<100;j++)
{
if(ac[j]==c)
{
pos=j;
break;
}
}
if(pos>-1)
{
if(xxx==1)
{
System.out.println ("Enter the amount you want to deposit ");
amt=Integer.parseInt(r.readLine());
Bal[pos]=Bal[pos]+amt+i;
}
else if(xxx==2)
{
System.out.println("Enter the amt you want to Withdraw");
int amt1=Integer.parseInt(r.readLine());
if((Bal[pos]-amt1)>1000)
Bal[pos]=Bal[pos]-amt;
else
System.out.println("Warning !!!!!");
}
else
System.out.println("Wrong entry ");
}
}
System.out.println("Thanking you ");
}
else
System.out.println("Thank you , Have a nice day ");
}
}
}}

/* input-output
* enter your name:-
* Arnab sarkar

* You a permanent member : Y / N
y
Please enter your accont no.
111
Your balance is :10000You can deposit or Withdrawal money : Press 1 for Deposit money and Press 2 for Withdrawal money
1
Please enter the amt you want to deposit
5000
Now do you want to Withdraw or Deposit money Y or N
n
your balance is 15000
Thank you , Have a nice day

*/