
C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith
النسخة 8الرقم المعياري الدولي: 978-1285867410
C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith
النسخة 8الرقم المعياري الدولي: 978-1285867410 تمرين 2
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 flag variable declared correctly? If not, what should you do to fix it?
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 flag variable declared correctly? If not, what should you do to fix it?
التوضيح
Refer code provided in Exercise 6-2 in t...
C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith
لماذا لم يعجبك هذا التمرين؟
أخرى 8 أحرف كحد أدنى و 255 حرفاً كحد أقصى
حرف 255