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
ANTONII [103]
2 years ago
11

Given: an int variable k, an int array current Members that has been declared and initialized, an int variable memberID that has

been initialized, and a boolean variable isAMember. Write code that assigns true to isAMember if the value of memberID can be found in current Members, and that assigns false to isAMember otherwise. Use only k, currentMembers, memberID, and isAMember.
Computers and Technology
1 answer:
Alekssandra [29.7K]2 years ago
4 0

Answer:

The c++ program is given below. Nothing is displayed as per the question.

#include <iostream>

using namespace std;

int main() {    

   // declaration and initialization of integer variables

   int k, memberID = 12, nMembers=5;

   bool isAMember;    

   // declaration and initialization of integer array

   int currentMembers[] = {12, 34, 56, 78, 90};    

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

   {

       if(memberID == currentMembers[k])

       {

           // when member is found in the array, the loop is exited using break

           isAMember = true;

           break;

       }

       else

           isAMember = false;

   }    

   return 0;

}

Explanation:

The program begins with declaration and initialization of integer variables and followed by initialization of the array holding the id of all the members.

The Boolean variable is declared but not initialized.

int k, memberID = 12, nMembers=5;

bool isAMember;

int currentMembers[] = {12, 34, 56, 78, 90};

After this, the array holding the id of the members is searched for the given member id. This is done using  a for loop and a if else statement inside the loop.

If the member id is present in the array, the variable isAMember is initialized to true otherwise it is assigned false.

When the variable isAMember is initialized to true, the break statement is used to exit from the loop.

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

   {

       if(memberID == currentMembers[k])

       {

           isAMember = true;

           break;

       }

       else

           isAMember = false;

 }

The break is used since other values of id in the array will not match the given member id and the variable, isAMember will be initialized to false even if the given member id is present in the array. Hence, it is mandatory to exit the loop once the given member id is found in the array.

This program can be tested for different values of the id of the members and different sizes of the array.

You might be interested in
A script sets up user accounts and installs software for a machine. Which stage of the hardware lifecycle does this scenario bel
DochEvi [55]

Answer:

deployment phase

Explanation:

This specific scenario belongs to the deployment phase of the hardware lifecycle. This phase is described as when the purchased hardware and software devices are deployed to the end-user, and systems implemented to define asset relationships. Meaning that everything is installed and set up for the end-user to be able to use it correctly.

6 0
2 years ago
Elias wants to name his data in an excel file. Which step is incorrect?
saul85 [17]

Now let me ask this question to everyone in this arena tonight. WHO WANTS TO WALK WITH ELIAS?

3 0
2 years ago
In which of the security mechanism does the file containing data of the users/user groups have inbuilt security?
max2010maxim [7]

Answer:

The answer is "It uses the section access with in the qlikview script".

Explanation:

QlikView is now QlikSense, it comes with section access, that protects against this danger. It a way of determining, which can display certain details, it is also known as objects, that can be displayed by whom and out of which domain, etc.

  • It can also be configured using the publishing of the company. In the data load script, users can use section access to maintain security.  
  • It uses the data for authentication and authorization within segment access and automatically decreases the information, such that users only have their information.
8 0
2 years ago
The navigation bar on the left side of ____ view contains commands to perform actions common to most office programs.
kondor19780726 [428]

Answer:

The navigation bar on the left side of File view  contains commands to perform actions common to most office programs.

Explanation:

It enable all kinds of operations such as opening a file, closing a file, saving the file, saving a file with a different name, listing recently opened document, etc.

The open option enable us to open an existing file, all the recent files will be listed in the recent option and there are no files opened newly or if the data are cleared often, then it will be empty.

A file can be opened and saved with the different name so that the recent change will be saved in the new file and there will be presence of existing file too.

4 0
2 years ago
Can someone please help me with this
inessss [21]

the first question answer is true

the second question answer is true

please brainliest me i just took the test so i know those 2 answers are correct!

3 0
2 years ago
Other questions:
  • Which table style option is useful to display aggregated data when it is checked? total row filter button last column header row
    8·1 answer
  • Edria was faced with a situation in which she was given sensitive information about twenty different clients, including their so
    13·2 answers
  • Match the following technologies with their applications.
    9·1 answer
  • Which of the following is technically not a programming language?
    12·2 answers
  • A device has an IP address of 10.1.10.186 and a subnet mask of 255.255.255.0. What is true about the network on which this devic
    9·1 answer
  • Consider the following network: proxy-cache On average there are 35 objects downloaded per second, and the average object size i
    14·1 answer
  • Double any element's value that is less than controlValue. Ex: If controlValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4
    8·2 answers
  • 4. Word Separator:Write a program that accepts as input a sentence in which all of thewords are run together but the first chara
    10·1 answer
  • A Security team is working with a client to evaluate the security of data and IT functions that are most critical to the operati
    13·1 answer
  • Write a function named shout. The function should accept a string argument and display it in uppercase with an exclamation mark
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!