Tuesday, February 21, 2006

Who I am To You ? Hum Aapke Hai Kaun ???? - Source Code For FLAMES

This site has been moved to http://www.99applications.com
To download code/application click the following link 99applications.com/java_programs and you can also find many c and c plus plus common programs in C & C++ section




Who I Am To You ???
Hum Aapke Hai Kaun??????

F.L.A.M.E.S

By - Krishnkanth Soni

In India, North-Indian teenagers, following small formula for choosing a boyfriend or girlfriend. That is FLAMES. This is a fun application.


What is FLAMES?
F for Friend
L for Lover
A for Affair
M for Marriage
E for Enemy
S for Sister


How the calculation?
Take guy name and girl name
Example: Rama and Sita

1.cut all common letters in those names, now the remaining words are "rma" and "sit"

2.Now calculate all the letters, that is 6 letters

3.Now take FLAMES calculate from the F and cut it on 6th letter

Example:
After cutting the FLAMES
FLAME

4. Now again calculate form the next letter keep on calculate until you will get one letter
that will decide your relationship.

Note: Flames is a funny logic in this testing if this example has caused any problems, please excuse me its only meant for fun!

Download API & Java Source Code For FLAMES here....

/**************************************************************************/
Java Program - Calculating Flames
Author@ Krishnakanth Soni
Feedback@ sonikrishnakanth@gmail.com

Usage: java Flames rama sita
/**************************************************************************/

Output Screen


public class Flames
{
private String name1 = "";
private String name2 = "";

public Flames(){
name1 = "rama";
name2 = "sita";
}

public void setNameOne( String name1 ){
this.name1 = name1.toLowerCase().trim().replaceAll( " ", "" );
}

public void setNameTwo( String name2 ){
this.name2 = name2.toLowerCase().trim().replaceAll( " ", "" );
}

public void setNames( String name1, String name2 ){
this.name1 = name1.toLowerCase().trim().replaceAll( " ", "" );;
this.name2 = name2.toLowerCase().trim().replaceAll( " ", "" );;
}

private String findDifference(){
String difference = "";
String temName = this.name2;
for( int i=0; i<name1.length(); i++ ){
String a = name1.charAt(i) + "";
if( name2.indexOf( a ) != -1 ){
name2 = name2.replaceFirst( a, "" );
}else{
difference += a;
}
}
difference += name2;
this.name2 = temName;
return difference;
}

public String getFLAMES(){
String flamesResult = "";
int difference = findDifference().length();
if( difference == 0 ){
if( name1.equals( name2 ) )
return "You have Given Same Names, So Can't find FLAMES";
else
return "Can't find FLAMES for the Given Names";
}
String fResult[] = { "FRIENDS", "LOVERS", "AFFAIR", "MARRIAGE", "ENEMIES", "SISTERS/BROTHERS" };
int k=0;
for( int i=5; i>0; i-- ){
int j=1;
while( j < difference ){
k++;
if( k == fResult.length )
k = 0;
j++;
}
String fResult1[] = new String[i];
int m = 0;
for( int kk=0; kk fResult.length; kk++ )
if( kk != k )
fResult1[m++] = fResult[kk];
fResult = fResult1;
if( k == fResult.length )
k = 0;
flamesResult = fResult[0];
}
return flamesResult;
}

public String getFLAMES( String name1, String name2 ){
String nameOne = this.name1;
String nameTwo = this.name2;
setNames( name1, name2 );
String flames = getFLAMES();
setNames( nameOne, nameTwo );
return flames;
}

public String toString(){
return "[ F.L.A.M.E.S For \"" + this.name1 + "\" And \"" + this.name2 + "\" Is \"" + getFLAMES() + "\" ] ";
}

public static void main(String[] args)
{
Flames fl = new Flames();
if( args.length == 2 ){
fl.setNames( args[0], args[1] );
System.out.println( "\n" + fl.toString() + "\n" );
System.exit(0);
}else{
System.out.println( "\nUse With Proper usage, Find a sample FLAMES Below\n" );
}
fl.setNames( "rama", "sita" );
System.out.println( "\n" + fl.toString() + "\n" );
}
}

Home

No comments:

Post a Comment