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
The variable grade can have any real number value from 0 to 100. Ask the user to enter a grade in numerical form. Write an if-el
Alborosie

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

int main()

{

float marks;

cout<<"Enter your grade value :";

cin>>marks;

if(marks>=90)

cout<<"Your grade is 'A'";

else if(marks>=80&& marks<90)

cout<<"Your grade is 'B'";

else if(marks>=70&& marks <=80)

cout<<"Your grade is 'C'";

else if(marks>=60&& marks <70)

cout<<"Your grade is 'D'";

else

cout<<"Your grade is 'F'";

}

8 0
3 years ago
_____ remove the part of an image starting from an edge​
Lapatulllka [165]
I think it’s cropping could be wrong though
4 0
3 years ago
Jackson is teaching a class the concept of the binary number system. Which term will he use to refer to the leftmost bit of a bi
storchak [24]
A. most significant bit
5 0
3 years ago
Identify examples of loop structures using comments in your code. Be sure your examples address each of the following: i. Item-b
Alex73 [517]

Answer:

item based for loop is used to iterate items in a collection .it is useful to apply some operations on item. Index based for loop is used to execute some logic repetitively. While loop also useful to execute a logic repetitively

Explanation:

item based for loop is used to iterate items in a collection .it is useful to apply some operations on item. Index based for loop is used to execute some logic repetitively. While loop also useful to execute a logic repetitively

in c#.net , following example explains this

using system;

void main(){

String[] names=new  names[20];

int counter=0;

//index based for loop

for(int i=0;i<20;i++){

console.read(names[i]);

}

//item based for loop

foreach(string s in names){

console.writeline(s);

}

//while loop

while(counter<20)

{

console.read(names[counter];

counter++;

}

}

4 0
3 years ago
About.com is considered a (an):
Andrei [34K]
About. com that changed its name recently to dotdash is basically a subject directory. It is a colection of blogs articles about various general intrests of writers. Most of the information it contains is not vetted and thus does not qualify as reference point.
7 0
3 years ago
Other questions:
  • You are able to change the formatting of a table after it is inserted into a placeholder. True or false
    9·2 answers
  • Which option is used to apply formatting to multiple objects on a single slide while still maintaining the ability to manage the
    14·2 answers
  • Working for the Internal Revenue Service is a career in public safety. A. True B. False
    14·1 answer
  • keeping in mind the role in order of precedence plays in equations, what would excel display as the result of the following equa
    14·1 answer
  • When parking on hills or an unlevel surface, make sure your_____is
    15·2 answers
  • All of the following are organization habits except:
    10·1 answer
  • Who distributes IP Address?
    10·1 answer
  • Whats wrong with my code for .addEventListener
    11·1 answer
  • What is the meaning of the term plot?<br>A. the final outcome of the story​
    8·1 answer
  • A regional transportation and logistics company recently hired its first ChiefInformation Security Officer (CISO). The CISO’s fi
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!