All time Pageviews

Wednesday 19 February 2014

How to create a love meter

                                      LOVE METER


                                                  -Here I'am going to show you how to create a love meter,So let us have a look at the coding



#include<cstdlib>
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main ()
{
char ans;
do {
system("CLS");
system("TITLE Lovemeter By charan zack");
string firstname, secondname, again;
cout <<"Welcome to lovemeter by charan zack\n";
cout << "Please enter first name: \n";
getline (cin, firstname);
cout << "Please enter second name: \n";
getline (cin, secondname);
float a=firstname.length();
float b=secondname.length();
float c=a + b;
float p= (a/c)*100 ;
cout << firstname  <<" loves "<< secondname << p << " percent\n";
cout <<"Do you want to calculate love again? (y/n) : ";
cin >>ans;
}
while((ans !='N')&&(ans !='n'));
return 0;
}

1 comment: