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
Companies increasingly want to allow employees to share files directly without having to maintain servers to provide FTP access.
jeyben [28]

Answer:

The answer is "use P2P method".

Explanation:

In Corporation are starting to regard P2P is a method, which enabling workers to transfer files directly, reducing the expenses and construction connected with a central network.

  • It allows corporations to make the use of often latent resources on both the computer for each worker.
  • It will also be forced to control access to data to protect the privacy and sensitive materials, and will also be able to encrypt files by code.

5 0
3 years ago
1.1. (30 points) Write a program to calculate the average number of cars sold by a car agency over a period of years for the fir
mario62 [17]

Answer:

count = 0

months = 0

years = int(input("Enter the number of years: "))

for year in range(1, years+1):

   cars_sold = int(input("Enter the number of cars sold in first six months: "))

   count += cars_sold

   months += 6

print("Number of months: " + str(months))

print("Number of cars sold in total: " + str(count))

print("Average number of cars sold per month: " + str(count / months))

Explanation:

Initialize the variables

Ask the user for the number of years

Create a for loop that iterates depending on the given number of years

Ask the user for the number of cars sold in the first six months of the year

Increment the count by given number and increment the months by 6 after each iteration

Print the months, count and, average

8 0
3 years ago
I need a quick way to see all hardware connected to my computer.
timofeeve [1]
Look it up..............
7 0
3 years ago
A _______ is used to present data in a simplified, graphical format that allows your audience to read less text while still bein
steposvetlana [31]
Your correct answer would be Legend.


answer choice is B.
3 0
4 years ago
Read 2 more answers
Which expression adds 1 to the element of array arrayname at index i?
NemiM [27]
I believe the answer is <span>++arrayName[ i ].

</span>
8 0
3 years ago
Other questions:
  • The dashed lines that display on your slide when you are moving an object are
    10·1 answer
  • which of the following information technology career fields generally requires the lowest level of education for an entry level
    9·1 answer
  • When a person visits a Web site, his or her IP address and the links he or she clicked on are automatically recorded. This is an
    9·1 answer
  • Imagine that you have configured the enable secret command, followed by the enable password command, from the console. You log o
    9·1 answer
  • Explain how software is distinct from hardware.
    8·2 answers
  • Draw a flowchart to accept two numbers, and then output the result as the first number
    11·1 answer
  • Who wanna be my friend !!​
    11·2 answers
  • Pleases Help ME An example of a _________________ impact is when a product is back ordered and the business contacts the custome
    5·1 answer
  • If you want to load the "my-data.csv" file to Dataframe so that you can explore find out the number of data items in the data se
    13·1 answer
  • Question 4 (5 points) If your social media accounts are___________, college admissions representatives can look at your social m
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!