Question: 1 . You ask the user of the program to enter an apple name 2 . your program initializes a flag called foundIt to false.
You ask the user of the program to enter an apple name
your program initializes a flag called foundIt to false. foundIt is a Boolean data type which is Javas primitive data type. It is used to store only true and false values
your program searches the array for the requested apple name
if it is found, the flag is set is true
After the array search is completed, the flag is checked for true or false
If flag is true, message is send that the apple name was found in the array. if flag is not true, the program prints a message that informs the user the apple name is not found in the array
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
