Add to Favorites    Make Home Page 694 Online  
 Language Categories  
 Our Services  

Home » Java Home » Language Basics Home » FLAMES program to find the relation between a boy and a girl.

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title FLAMES program to find the relation between a boy and a girl.
Author Rajarathinam DilliBabu
Author Email i_am_dil6 [at] yahoo.co.in, raja_tirupur [at] yahoo.co.in
Description It is a program to find the relation between a boy and a girl.
The program will ask for both boy's and girl's name and it will compare the names and will give the relation between them.
Category Java » Language Basics
Hits 42287
Code Select and Copy the Code
import java.io.*; class string2 { public static void main(String args[]) throws IOException { int m; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter ur name: "); String first=br.readLine(); System.out.println("Enter ur partner's name: "); String second=br.readLine(); StringBuffer s1=new StringBuffer(first); StringBuffer s2=new StringBuffer(second); int a=s1.length(); int b=s2.length(); //comparing two names label: for(int i=0;i<a;i++) { char c=s1.charAt(i); // System.out.println(c); for(int j=0;j<b;j++) { char d=s2.charAt(j); if(c==d) { ////k++; s1.deleteCharAt(i); s2.deleteCharAt(j); ////System.out.println(s1 +" " +s2); a=s1.length(); //m=a; b=s2.length(); i=0; j=0; // continue label; } } //// System.out.println(k); } int d=(a+b); System.out.println("the number is : " +d); //int n=-1,l=0,p=0; StringBuffer s3=new StringBuffer("flames"); String s4=new String(); label1: for(int i=0;i<5;i++) {int n=-1,l=0,p=0; for(int j=1;j<=d;j++) { n++; l++; //int p=0; if(n>s3.length()-1) { char e=s3.charAt(p); if(l==d) { s3.deleteCharAt(p); //String s4=new String(); s4=s3.substring(p,s3.length()); ////System.out.println(s4); s3.delete(p,s3.length()); ////System.out.println(s3); s3.insert(0,s4); ////System.out.println(s3); break; } else{ p++; if(p==s3.length()) {p=0; } } } else { char e=s3.charAt(n); if(l==d) { s3.deleteCharAt(n); s4=s3.substring(n,s3.length()); ////System.out.println(s4); s3.delete(n,s3.length()); ////System.out.println(s3); s3.insert(0,s4); ////System.out.println(s3); break; } //break; } } } ////System.out.println(s3); char result=s3.charAt(0); switch(result){ case 'f': System.out.println(second+" is ur Friend"); break; case 'l': System.out.println(second+" is ur Love"); break; case 'a': System.out.println(second+" is ur Affection"); break; case 'm': System.out.println("u r going to marry "+ second); break; case 'e': System.out.println(second + " is ur Enemy"); break; case 's': System.out.println(second +" is ur Sister"); break; } } }

Related Source Codes

Script Name Author
Sending mail Using JavaMail to Yahoo and Gmail accounts sai prasad
Simple Program in Java to Implement Multithreading Satish.K
Simple Calculator in Java Using Remote Method Invocation Satish.K
Guest Book Application Using Servlets Satish.K
String Manipulation Using Stringification Satish.K
String Manipulation Using Stringification Satish.K
Moving Ball Application Using Java Beans Satish.K
Rapid Roll game subrahmanyeswararao
student mgm arpan
Sourav Datta
Download Manager Sagar
Address Book in Java Rahul Chouhan
address book using java database connectivity(jdbc-msaccess) shekhar bansal
sun Steganography B.Rajavel
Connecting Java with MS-Access - Inserting data in Aseem

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions
Copyright ©2003-2017 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=752


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review