NIC Calculator(Source code for calculate Gender and B'day from NIC number)

Manojfdo

Member
Sep 7, 2006
590
18
0
I didn't handle the String.Index.OutofBound Exception

//after the last catch
catch(String.Index.OutOfBoundsException e){
JOptionPane.showMessageDialog(null,"Invalid NIC Number","Error",JOptionPane.ERROR_MESSAGE);
}

I just used the simple JOptionPane to code this
 

Manojfdo

Member
Sep 7, 2006
590
18
0
I reupload the file with a correction to the code.. if you dl it before the correction make these changes to it

public static String getMonth(int k){
int rem=0,cal=0,b4=0,i,month=0,day=0;
for(i=1; i<=12; i++)
{ if(i<=7)
{
rem=i%2;
if(rem>0){ cal+=31; }
else if(i==2){ cal+=29; }
else{ cal+=30; }

}
else
{
rem=i%2;
if(rem==0){
if(i==8){ cal+=31; }
else{ cal+=31; } //change here
}
else{ cal+=30; } //change here

}

if (cal>=k){ break;}
else { b4=cal; }
}
 

Manojfdo

Member
Sep 7, 2006
590
18
0
Wada karanne nathu ayata... Kattiyama aha ganna :)

Java Run karann ona nag oya golloanta Java Runtime Environment 1k ona..
http://www.java.com/en/download/index.jsp methaning Dl karanna :)

eeta passe Console(cmd/msdos) 1k open karala oya file 1k tiyene directry 1k ta yanna..
eta passe java NIC2 kiyala type karala enter karanna....

Mata Exe 1k hadann puluwan eth ethakota Java wala main ambition 1k nathi wenwa ( platform independence)..

eth oya steps tika Java dann ayata simple wunata danne nathi ayata amarui.. 1k hinda mam exe 1k upload karanna... (java class waling exe hadann puluwan habai 3rd party software 1k gann ona)

http://www.mediafire.com/?i5085w85y2gn4rd
Exe 1k ona ayaata