Question: Here is code in c++. I need a function that when I ask the user what cat the want to see, they will type in

Here is code in c++. I need a function that when I ask the user what cat the want to see, they will type in the cats name and it will bring up the rest of the information for it. So, if it asks 'What cat do you want to know about?" The user would type in one of the names that's already provided, like "Lulu". Then it would return the information about "Lulu" (name,color,size) the information is hard coded so i just need to find a way to pull specific structure info from the array. There will be no other user input other then typing the cats name and then see the rest of the information about that specific cat.

#include using namespace std;

struct cat{

string name;

string color;

int size; };

int main() {

const int SIZE=3;

cat values[SIZE];

int choice;

values[0].name="Chad";

values[0].color="Orange";

values[0].size=2;

values[1].name="Lulu";

values[1].color="Black";

values[1].size=3;

values[2].name="Garth";

values[2].color="white";

values[2].size=4;

cout << "What cat do you want to know about?" << endl;

cin>>choice;

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 Databases Questions!