Ask Question
30 November, 08:33

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.

+4
Answers (1)
  1. 30 November, 08:50
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers