1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tomtit [17]
3 years ago
5

given:an int variable k,an int array currentMembers that has been declared and initialized,an int variable memberID that has bee

n initialized, anda boolean 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, memberID, and isAMember.
Computers and Technology
1 answer:
Oksi-84 [34.3K]3 years ago
7 0

Answer:

// The code segment is written in C++ programming language

// The code segment goes as follows

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

{

//check if memberID can be found in currentMembers

if (currentMembers[k] == memberID){

// If yes,

// assigns true to isAMember

isAMember = true;

k = nMembers;

}

else{

isAMember = false;

// If no

// assigns false to isAMember

}

}

// End of segment:

The following assumption were made in the code segment above.

There exists

1. An already declared and initialised int array currentMembers.

2. An already initialised int variable memberID

Line 3 initiates a loop to scan through the array

Line 6 checks for the condition below

If current element of array equals memberID then

It assigns true to isAMember and nMembers to k

Else

It assigns false to isAMember

You might be interested in
Can you help me in my work
Ilia_Sergeevich [38]

Answer:

Step 1: harvest. First, you need to select the leaves for harvest. ...

Step 2: steaming. The next step is to heat the leaves by steaming them. ...

Step 3: shaping. ...

Step 4: oxidation. ...

Step 5: drying. ...

Step 6: enjoy your cup of home grown tea. ...

Step 7: storing leftover tea leaves.

5 0
2 years ago
How to build an arch bridge​
Shkiper50 [21]

get resources like nails and wood and a couple rolls of tape if anything goes wrong

3 0
4 years ago
In an image citation, what piece of information is listed first?
kondaur [170]
In a image citation the piece of information listed first is "last name"
can you give us multiple choice?
7 0
3 years ago
Disadvantages of the divisional organization structure are _____. each division is able to operate independently from the parent
Fantom [35]

Answer:

Disadvantages:

1. A division may feel separated from the parent company because it has too much independence

2. This feeling of separation may lead to the division only worrying about meeting it's goals and objectives and not the companies as a whole

3. This system may be more expensive to operate and cannot share resources with other divisions

Explanation:

8 0
2 years ago
Identify a stressor in your life. Conduct an internet search to locate at least two reliable sources of information on effective
Gre4nikov [31]

Answer:

The biggest stressor in my life is certainly accountancy. I need to divide my earning among my family members, however, I had to work as well. and hence, I wanted to cover this automatically. I decided to surf the internet. I realized I need to first find the keyword. And I found it as budgeting and the monthly income. I got all my answers. The source explained to be how I can transfer a part of my income to each of my family members, and also to grocery sites like Amazon, the daily service provider who provide various home servants, for electricity bills, yearly water tax, house tax, and all my expenses. And now I can relax and work, as with one click, I can now pay all my bills, as well as I can order for instant food deliveries, call plumbers, electricians, etc any time and everything I can think of. I have no headache now, and I can devote all of my hours to work. And that has also increased my income since I went automatic.

Explanation:

Thus, we need to first find the keyword, and then find the best site from the list that appears. And then we need to research through that site and find the solution.We can make use of the search engine commands as well.

4 0
3 years ago
Other questions:
  • How would a top margin be set
    7·1 answer
  • After modifying the font of the Subheading1 style, you notice that the font of Subheading2 has also changed. What is the most li
    12·2 answers
  • Grooves and polished surfaces on desert pebbles are most likely caused by
    10·1 answer
  • Write a C++ program that stores the integers 50 and 100 in variables and stores the sum of these two in a variable named total.
    11·1 answer
  • What protections do not apply to the content in a wiki?
    5·2 answers
  • What were second generation languages that required detailed knowledge of the computer's hardware and a lot of spare time to wri
    11·1 answer
  • What can be used to help diagnose and fix network connection problems?
    8·1 answer
  • Why do we use if statements?
    9·1 answer
  • For python how do I ask the user how many numbers they want to enter and then at the ending add those numbers up together?
    10·1 answer
  • A ____________________ machine is used to gather or arrange in their proper sequence.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!