Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions

Question

=+ Differentiate between real and nominal deficits and surpluses.

Answered: 1 week ago