Question: #include #include using namespace std; int main() { int name=0; string arr[5]; string NameEntered; cout <

#include

#include

using namespace std;

int main() {

int name=0;

string arr[5];

string NameEntered;

cout <<"Enter 5 different names..."<< endl;

while (name<5){

cout <<"Enter name # "<<(name+1)<<":";

cin >> NameEntered;

bool status =false;

break;

for(int i=0; i

if(NameEntered == arr[i]) {

status = true;

break;

}

}

if(status) {

cout << "You already entered that name!" << endl;

}

else{

arr[name] = NameEntered;

name++;

}

}

cout << " Here are the names: " << endl;

for(int i=0; i<5; i++)

cout << arr[i] << endl;

return 0;

}

MISMATCHFOUNDONLINE0002:

ACTUAL:Enter~name~#~1:

EXPECTED:Enter~name~#~1:~Bob

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!