Ask Question
27 February, 21:02

Given : an int variable k, an int array currentmembers that has been declared and initialized, an int variable nmembers that contains the number of elements in the array, an int variable memberid that has been initialized, and a bool variable isamember, write code that assigns true to isamember if the value of memberid can be found in currentmembers, and that assigns false to isamember otherwise. use only k, currentmembers, nmembers, and isamember.

+2
Answers (1)
  1. 27 February, 23:47
    0
    Isamember = false;

    for (k = 0; k < nmembers; k++)

    {

    if (memberid = = currentmembers[ k ])

    {

    isamember = true;

    break; / / your class may not be up to this, just delete it

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Given : an int variable k, an int array currentmembers that has been declared and initialized, an int variable nmembers that contains the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers