Thursday, 28 August 2014

flames calculator using cpp

#include<iostream.h>
#include<conio.h>
#include<string.h>
class flames
{     public:
      int c,d,e,i,j,h,k,p;char f[30],g[30],z,o;
 void input()
{       cout<<"\n"<<"\n"<<"\n"<<"\n";
      cout<<"enter names which u want to find relation\n";
     cin>>f>>g;
     c=strlen(f);
      d=strlen(g);
 e=c+d;
// cout<<"enter first name word by word to verify\n";// for(i=0;i<c;i++)//  {cin>>f[i];cout<<"\n ";} // cout<<"enter second name word by word to verify\n";     // for(j=0;j<d;j++)     // {  // cin>>g[j];cout<<" \n";    // }
      }
void process()
      {h=0;
      for(i=0;i<c;i++)
      { for(j=0;j<d;j++)
{if(f[i]==g[j])
  {h++; f[i]=z;g[j]=o; }
    else
     {h=h;}}}}

void pi()
{k=e-(2*h);}
void visu(){
cout<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"\n"<<"                       ";
if(k==2||k==4||k==7||k==9||k==20||k==22||k==25||k==2||k==4)
{cout<<"                    ENEMIES           ";}
else if(k==3||k==5||k==14||k==16||k==18||k==23)
 {cout<<"           FRIENDS           ";}
else if( k==10||k==19)
{cout<< "                             LOVE                " ; }
else if
(k==12||k==8||k==13||k==17||k==28||k==30){cout<<"                  AFFECTION                   "; }
else if
(k==6||k==11||k==15||k==26){cout<<"                         MARRIAGE                ";}
else
{cout<<"                                       SISTER";}}};
void main()
{clrscr();flames f;f.input();clrscr();f.process();f.pi();f.visu(); getch();}

No comments:

Post a Comment