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
ANTONII [103]
3 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]3 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
How fast is a backwards long jump in Super Mario 64?
Kamila [148]

Answer:

I honestly don't know if you're being serious or not as this was a popular thing a few years ago, there are a few videos on yt, one particularly from 2008 that answers your question pretty well.

Clipping through a loading area requires at least 400 speed. But if you're just interested in the usual speed, there are multiple glitches to make him go faster than his usual x3.5 increased running speed (which is the speed you get at the LEAST when BLJing) but it seems the average is  -200. I've seen people get up to -900 though, so.

Basically, it can vary. In a very specific area he can get max momentum of -9373, which is probably the fastest even though it's against a wall.

6 0
2 years ago
To make a profit the price of the items sold in the furniture store are marked up by 80 %after marking up the prices each item i
Verdich [7]

Answer:

The algorithm is as follows:

1. Start

2. Display "Input Item Price: "

3. Input Price

4. Markup = Price + 80% * Price

5. Selling_Price = 10% * Markup

6. Display "The Selling Price is "+Selling_Price

7. Stop

Explanation:

This signals the beginning of the algorithm

1. Start

This is a prompt that asks for the price of the item

2. Display "Input Item Price: "

This gets the price of the item

3. Input Price

This calculates the Markup (80% of the inputted price)

4. Markup = Price + 80% * Price

This calculates the selling price (10% of the markup)

5. Selling_Price = 10% * Markup

This prints the selling price

6. Display "The Selling Price is "+Selling_Price

This signals the end of the algorithm

7. Stop

7 0
2 years ago
Electronic transmission of information standards, such as transaction and code sets and uniform identifiers, are covered underQu
Mila [183]

Answer:

option A

Explanation:

Option A.

With the use of Administrative simplification, we can transform all the paper work to electronic media such as electronic receipts or electronic mail. By shifting towards electronic means in Administrative simplification we are actually saving a lot of time by helping the human resource and from the laborious tasks of paper work and data management.

The management of electronic means is very easy and friendly, it is also a reason for implementing administration simplification as well.

3 0
3 years ago
How many rows appear in a truth table for the compound proposition: \[(p \leftrightarrow q) \oplus (\neg p \leftrightarrow \neg
AURORKA [14]
Let me re-write the proposition:

p↔q⊕(¬p↔¬r)∧¬q.

Generally, the number of rows in a truth table depends on the number of Variables. Here we have 3 Variables: p,q and r. Each of them can have either the value of 1 or 0, which gives us 2*2*2 possibilities, or 2³, that is 8 possibilities and 8 rows:

p=0, q=0, r=0
p=0, q=0, r=1
p=0, q=1, r=0
p=0, q=1, r=1
p=1, q=0, r=0
p=1, q=0, r=1
p=1, q=1, r=0
p=1, q=1, r=1







4 0
2 years ago
Microsoft® Publisher does which of the following?
AVprozaik [17]

Answer:

Creates items using page layout skills

8 0
2 years ago
Read 2 more answers
Other questions:
  • A musical compact disc is an example of
    13·1 answer
  • The times per second an audio file is converted from analog to digital is the ______. audio file format bandwidth sample rate wa
    5·2 answers
  • You can use RWA to demonstrate how to do something special on the web, such as displaying articles found on websites that suppor
    15·1 answer
  • Which of the following is not a main function within end user support?
    13·1 answer
  • Katarina is deciding whether to buy a desktop or a laptop computer. What will most likely help Katarina make her decision?
    10·2 answers
  • An electronic storage file where information is kept is called a cpu. true false
    11·1 answer
  • Can an iphone user see when an android user is typing
    10·2 answers
  • Select the correct text in the passage,
    10·1 answer
  • 3n - 12 = 5n - 2<br> how many solutions?
    15·1 answer
  • Name:
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!