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
Write an application that counts by five from 5 through 500 inclusive, and that starts a new line after every multiple of 50 (50
inessss [21]

Answer:

Explanation:

We must create a cycle for to count 5 by 5 then a with a conditional if, we are going to identify every multiple of 50 to start in a new line.

class Count{

public static void main(String[] args){

for(int i=5; i<=500; i+=5){

System.out.print(i + " ");

if(i%50==0)

System.out.println();

}

}

}

5 0
4 years ago
If a small monster collector:- Has 16 small monster containment devices and intends to use all of them.
valina [46]

Answer:

ajhgdfjjjh4hd

Explanation:gbbh

guguubshuhv

8 0
3 years ago
Write a Python function uniquely_sorted() that takes a list as a parameter, and returns the unique values in sorted order.
ivann1987 [24]

Answer:

   Following is the program in Python language  

def uniquely_sorted(lst1): #define the function uniquely_sorted

   uni_que = [] #creating an array

   for number in lst1: #itereating the loop

       if number not in uni_que: #check the condition

           uni_que.append(number)#calling the function

   uni_que.sort() #calling the predefined function sort

   return uni_que #returns the  unique values in sorted order.

print(uniquely_sorted()([8, 6, 90, 76])) #calling the function uniquely_sorted()

Output:

[6,8,76,90]

Explanation:

   Following are the description of the Python program

  • Create a functionuniquely_sorted() that takes "lst1" as a list parameter.
  • Declared a uni_que[] array .
  • Iterating the loop and transfer the value of "lst1" into "number"
  • Inside the loop call, the append function .the append function is used for adding the element in the last position of the list.
  • Call the predefined function sort(for sorting).
  • Finally, call the function uniquely_sorted() inside the print function.

   

7 0
4 years ago
Can anybody please help me with 7.4.7 spelling bee codehs?
Eddi Din [679]

Answer:

What are you trying to say?

Explanation:

7 0
3 years ago
A healthcare organization received notification that a hospital employee’s laptop that contained PHI was inadvertently left at a
timofeeve [1]

Answer:

Implement better protection and inform the staff.

Explanation:

The situation given in the question can be very alarming for a healthcare organization since the laptops contain critical information and details about the employee's work.

To prevent this from occuring again in the future, the organization should educate their employees on cyber security and having a strong password. They also should implement softwares on the computers against such incidents, which can be softwares that can lock the computers and delete files that are important to the organization if an unauthorized entry is detected. In order to protect the information, they can also use a backup system for every computer the employee's use.

I hope this answer helps.

7 0
3 years ago
Other questions:
  • Which wildcat character will return a single character when using the find dialog box
    14·1 answer
  • Write a function get_initials(the name) that takes a string of a name and returns the initials of the name, in upper case, separ
    12·1 answer
  • Rick works for the government and is investigating a small business that the government suspects has been cheating on its taxes.
    15·1 answer
  • What are the four types of technical drawing?​
    9·1 answer
  • Write a function that receives three StaticArrays where the elements are already i n sorted order and returns a new Static Array
    11·1 answer
  • Where is the best place to self learn c++ or c# that is free?
    6·2 answers
  • I'm very confused about this, I am seeing multiple different answers and I thought the answer was obvious, but guess not.
    15·2 answers
  • which of these devices has 3000-A fuses that provide fault protection for the 4000-a, 480/277-V, 3-phase bus that feeds seven ci
    5·1 answer
  • Draw the following diagrams to represent the information system chosen in assignment 1 Context diagram The context diagram is ex
    12·2 answers
  • What are the different elements of a window?​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!