Monday, 13 January 2014

FLAMES IN JAVA

Here is the flames code in java.

The number for counting  will be depends on the two names given at the begining.

import java.util.*;
import java.lang.*;
class flame{
public static void main(String args[]){
int i,n,m,l,l1,k,j,count=0;
char o;
String n1,n2,f,g,krish,fd;
String[] sA;
String[] e;f="FLAMES";
System.out.println("*************************************"); System.out.println();System.out.println("\t KRISHCDBRY PRESENTS");
 System.out.println("\t ----  FLAMES  ----");
 System.out.println();
System.out.println("*************************************");
 System.out.println();
StringBuilder mF = new StringBuilder(f);
try {
System.out.println("HAI, ENTER BOTH OF YOUR FULL NAMES...");
System.out.println();
Scanner sc = new Scanner(System.in);
Scanner sc1 = new Scanner(System.in);
n1 = (sc.nextLine()).toUpperCase();
 n2 = (sc1.nextLine()).toUpperCase();
 l = n1.length();
 l1 = n2.length();
for(i=0;i<l;i++){
for(j=0;j<l1;j++) {
 if(n1.charAt(i)==n2.charAt(j)){
count = count+1;
}
}
}
n = (count*10)+(l+l1);
for(i=6;i>1;i--)
{
 l = mF.length();
k = (n-1)%l;
  mF.setCharAt(k, '.');
 g = new String(mF);
if(g.charAt(l-1) != '.'){
sA = g.split("\\.");
mF = new StringBuilder(sA[1].concat(sA[0]));
}
else{   krish = ""+g.charAt(0);
  for(j=1;j<l-1;j++)  {  
 krish = krish+""+g.charAt(j);
   mF = new StringBuilder(krish);
  }}}
fd = ""+mF; System.out.println();

if(fd.equals("F")||fd.equals("F.")){  System.out.println("YOU BOTH ARE GOOD FRIENDS");                 }
if(fd.equals("L")||fd.equals("L.")) {  System.out.println("YOU BOTH ARE DEEP LOVERS");                 }
if(fd.equals("A")||fd.equals("A.")) {   System.out.println("YOU BOTH HAVE AFFECTION TO EACH OTHER");                }
if(fd.equals("M")||fd.equals("M.")) {  System.out.println("YOU WILL GET MARRIED");                 }
if(fd.equals("E")||fd.equals("E.")) {  System.out.println("YOU BOTH ARE ENEMIES");                 }
if(fd.equals("S")||fd.equals("S.")) {   System.out.println("YOU BOTH ARE SIBLINGS");                }
}

catch(Exception x){ }}}


Share this article

0 comments:

Post a Comment

 
Copyright © 2014 krishcdbry • All Rights Reserved.
Distributed By Free Blogger Templates | Template Design by BTDesigner • Powered by Blogger
back to top