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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started