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
Basile [38]
3 years ago
8

Given : an int variable k, an int array currentMembers that has been declared and initialized, an int variable nMembers that con

tains 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 .
Computers and Technology
1 answer:
atroni [7]3 years ago
6 0

Answer:

The following are the code in the Java Programming Language.

//set the for loop

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

{

//check that currentMembers[k] is equal to the memberID

if (currentMembers[k] == memberID)

{

//then, initialize isAMember to true

isAMember = true;

//and initialize the value of nMembers in k

k = nMembers;

}

//otherwise

else

{

//initialize isAMember to false

isAMember = false;

}

}

Explanation:

<u>The following are the description of the program</u>.

  • Set the for loop statement that iterates from 0 and stops at the variable 'nMembers'.
  • Set the if conditional statement that checks the variable 'currentMembers[k]' is equal to the variable 'memberID' then, initialize 'true' boolean value in the variable 'isAMember' and also initialize the value of the variable 'nMembers' in the variable 'k'.
  • Otherwise, initialize 'false' boolean value in the variable 'isAMember'.
You might be interested in
If you press the Tab key when you're in in the last cell of a table,
KengaRu [80]
The answer is B.

If you press the tab key when you're in the last cell of a table, you will add a new blank row
8 0
3 years ago
Read 2 more answers
To join a social network you create an avatar true or false
svp [43]
False because not all social media webstites provide avatars
7 0
3 years ago
Read 2 more answers
Algorithm and flowchart:- find the product of two number (a and b)​
Korvikt [17]

Answer:

i have no idea a i guess

Explanation:

5 0
3 years ago
Which of these is an advantage of having multiple layers in a drawing and enables you to make changes to one part of an image wi
Ivan

Answer:

enables you to make changes to one part of an image without accidentally changing other parts

Explanation:

Computer aided designs incorporate the use of multiple layers in drawings. The first layer is known as the layer 0, while the present layer the designer is working on is known as the current layer. The advantage of the incorporation of layers in designs include the following

1. It helps objects to be altered, grouped, hidden and moved as the designer wishes.

2. Layers can be grouped and worked on separated and common properties like color and line weight assigned to them.

3. Layers can be manipulated as the user wishes. They can be locked, frozen, turned off, etc.  Locking prevents accidental changes being made on objects.

4 0
3 years ago
18. The push rod connects to the _______, which is designed to pivot back and forth to open and close the valve.
spin [16.1K]
In an overhead valve engine, pushrods connect to A. rocker arm which pivots and opens valves
6 0
3 years ago
Read 2 more answers
Other questions:
  • I have a bag of trail mix.half of the bag contains peanuts.1/4of the bag is chocolates candies, and 1/4of the bag is dried fruit
    12·2 answers
  • How do I cancel my membership or Subscription on here
    11·1 answer
  • Write a function that iteratively appends random 1's and 0's to an array to form a binary number. The function returns the binar
    13·1 answer
  • Do you watch markiplier?
    13·2 answers
  • An application with which you can perform calculations on numbers and work with other data
    8·1 answer
  • (Help please I don't know what to choose because it's both text and email but I can only pick one. HELP!!!!!!!!!!)
    6·2 answers
  • To connect a peripheral device to a computer to exchange data, find the appropriate ________ for the device.
    7·1 answer
  • Who can add entries to value log
    8·1 answer
  • Please solve this in JAVA<br><br> Please see the attachment
    10·1 answer
  • Ethics related to all <br> artificial intelligence?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!