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
F.L.A.M.E.S
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
/**************************************************************************/
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
6 Comments:
kaka!!!! eamanna rasinava.Kani edo error chupistundi compile chesthe.oka sari correct code malli copy paste ;cheyyi soni!
bye
why don't some html tags such as <pre> to keep your code formatted. I suggest that you host your code somewhere on the net and provide a link here. That would be better!
hey can't this pgm be done in much easier way like using a string buffer and a for loop with nested for and then use the deleteCharAt() function...i tried it this way always gives me logical error...it is not able to correctly compare and remove the pairs
hey! this program is actually my project... the only problem is it won't RUN. the error is this "java.lang.NoClassDefFoundError; Flames"....
huhuhu, i almost got it...
please help guys!!!!! ty
I never go to my doctor anymore asking for pain killers prescription and then be turned down at the end, all I do is order online from www.medsheaven.com hassle free and low cost, they have three pain killers listed on their website which are ultram tramadol celebrex that you buy, and the best part is no prescription required!!!
Hi my name is Lime, I always buy Valium from MedsHeaven.net , I totally recommend medsheaven , authentic meds and quick delivery.
Post a Comment
<< Home