expand icon
book C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith cover

C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith

النسخة 8الرقم المعياري الدولي: 978-1285867410
book C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith cover

C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith

النسخة 8الرقم المعياري الدولي: 978-1285867410
تمرين 3
Searching an Array for an Exact Match
In this exercise you use what you have learned about searching an array for an exact match. Study the following code, and then answer Questions. Note that this code may contain errors.
string apples[] = {"Gala", "Rome", "Fuji", "Delicious"};int foundIt = false, i;const int MAX_APPLES = 4;string inApple;cout ? "Enter apple type:";cin ? inApple;for(i = 0; i = MAX_APPLES; i++){if(inApple == apples[i]){foundIt = true;}}
Is the comparison in the if statement done correctly? If not, how can you fix it?
التوضيح
موثّق
like image
like image

Refer code provided in Exercise 6-2 in t...

close menu
C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith
cross icon