answer.
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]
1 year 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]1 year 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
At one college, the tuition for a full-time student is $8,000 per semester. it has been announced that the tuition will increase
Softa [21]
8780.9 i think i dont know for sure
7 0
1 year ago
LAB: Miles to track laps. (PLEASE CODE IN PYTHON)
bekas [8.4K]

Answer:

The program in python is as follows:

def miles_to_laps(user_miles):

     return (user_miles/0.25)

mile = float(input("Number of Miles: "))

print("Number of laps: ",end="")

print('{:.2f}'.format(miles_to_laps(mile)))

Explanation:

The first line defines the function miles_to_lap

def miles_to_laps(user_miles):

This line returns the equivalent number of laps

     return (user_miles/0.25)

The main method starts here

This line prompts user for input

mile = float(input("Number of Miles: "))

This line prints the string "Number of laps", without the quotes

print("Number of laps: ",end="")

This prints the equivalent number of laps to two decimal places

print('{:.2f}'.format(miles_to_laps(mile)))

3 0
2 years ago
Read 2 more answers
The domains of the risk IT framework mutually inform each other, creating flexibility and agility. It is possible to uncover a p
Andrej [43]

Answer:

The best option is A).True

Explanation:

This is because, according to the statement, it is possible to uncover a potential threat in the risk governance domain and quickly assess its impact using the risk evaluation domain in an IT environment. The risk IT framework is used in an IT environment for security of domains, the business involved, etc.

6 0
2 years ago
JAVA...Write a statement that calls the recursive method backwardsAlphabet() with parameter startingLetter.
scoray [572]

Answer:

RecursiveCalls.backwardsAlphabet(startingLetter);

Explanation:

The statement that is needed is a single-line statement. Since the class RecursiveCalls is already in the same file we can simply use that class and call its function without making a new class object. Once we call that class' function we simply pass the variable startingLetter (which is already provided) as the sole parameter for the function in order for it to run and use the letter 'z' as the starting point.

       RecursiveCalls.backwardsAlphabet(startingLetter);

3 0
1 year ago
One factor affecting digital camera quality is the number of pixels, measured in ____, used to store the data for each image.
Vlada [557]
One factor affecting digital camera quality is the number of pixels, measured in megapixels, use to store the data for each image.
5 0
2 years ago
Read 2 more answers
Other questions:
  • In a spreadsheet, the instructions for carrying out calculations are called __________. recalculations formulas templates macros
    13·1 answer
  • ______ is a statistic that measures how quickly the staff corrected a network problem after they arrived at the problem site. MT
    9·1 answer
  • Consider the following scenario: "You are an assistant to the accounting manager for a small company that sells sports equipment
    5·1 answer
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • Instead of sending an entire file in one big chunk across the​ Internet, __________ is used which dices the file up into little
    12·1 answer
  • With Voice over Internet Protocol (VoIP), _____. a. voicemails cannot be received on the computer b. call quality is significant
    6·1 answer
  • Lynn runs the locate command and the results include many files from a directory that she doesn't want to include in her search.
    11·2 answers
  • A company with a large number of hosts creates three subdomains under a main domain. For easier management of the host records,
    11·1 answer
  • Select the correct answer. Andy wants to become a multimedia producer. Which degree can help him achieve this goal? A. bachelor’
    5·1 answer
  • A school has 100 lockers and 100 students. All lockers are closed on the first day of school. As the students enter, the first s
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!