63 126
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #26894 in C++ for jaymer

Question #26894
Write a program to ask the user to input the name of boy and name of girl. Count the number of common letters to their names and add them up. Determine the corresponding equivalent using the games FLAMES. (F = riends, L = Lovers, A = Angry, M = arriage , E = Enemies, S = Sweet)
Expert's answer
#include <iostream>
#include <string>
using namespace std;

int main(){
string _flames[] = {"Friends", "Lovers", "Angry", "Marriage", "Enemies", "Sweet"};
string _boy, _girl;
int _common = 0;
cout<<"Input the name of boy:";
cin>>_boy;
cout<<"Input the name of girl:";
cin>>_girl;
& for ( int i = 0; i < _girl.length(); i++ )
& {
& _common += count(_boy.begin(), _boy.end(), _girl[i]);
& }
cout<<_flames[_common%6]<<endl;
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions