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
suter [353]
2 years ago
10

In JAVA,

Computers and Technology
1 answer:
Dahasolnce [82]2 years ago
5 0

Answer:

The program to this question as follows:

Program:

public class Main //define class main

{

public static void main(String[] args)  //define main method

{

boolean isAMember = false; //define boolean variable isAMember

int currentMembers[]={1,72,36,43,51,61,72,80}; //declare and initialized array.

int memberID=72; //define integer variable memberID.

for(int k = 0; k < currentMembers.length; k++) //loop.

{

if(currentMembers[k] == memberID) //conditional statement.

{

isAMember = true; //assign value true.

break;

}

System.out.print("true"); //print value.

}

}

}

Output:

true

Explanation:

The above java program to this question can be described as:

  • In java program we define a class that is "Main" inside this class we define a main method in the main method we define variables that are "k, memberID, isAMember, currentMembers".
  • The variable k and memberID is an integer variable that is used in the loop and use for match condition. and currentMembers is an integer array that is declared and initialized. and isAMember is a boolean variable that returns only true or false value.
  • Then we define a (for) loop in this loop we check condition we use if block. In if block, we check that currentMembers array value is equal to memberID. if this condition is true so we assign value true in "isAMember" variable and print its value.
You might be interested in
Write a statement that reads 5 successive integers into these variables that have already been declared: x1, x2, x3, x4, x5. The
prisoha [69]

Answer:

Following are the statement in C++ language :

#include <iomanip> // header file  

using namespace std; // namespace

int main() // main method  

{

   int x1,x2,x3,x4,x5; // variable declaration

cout<<" Enter the 5 sucessive integer:";

cin>>x1>>x2>>x3>>x4>> x5; // taking 5 input from user

cout<<right;

// prints each  of  its own line and form a right-justified  

cout<<setw(5)<< x1 << "\n" << setw(5) << x2 << "\n" <<setw(5) << x3 << "\n" << setw(5) << x4 << "\n" << setw(5) << x5 << "\n";

return(0);    

}

Output:

Enter the 5 sucessive integer: 45

23

445

6

8

 

  45

  23

 445

   6

   8

Explanation:

Description of program is given below  

  • Declared a 5 integer value x1,x2,x3,x4,x5 respectively.
  • Read the 5 integer value from user by using cin funtion.
  • Finally Print these 5 value in its own line and form a right-justified by using setw() function on it
5 0
3 years ago
The ________ identifies staff reaction and response times as well as inefficiencies or previously unidentified vulnerabilities.
Paraphin [41]

Answer:

simulation test

Explanation:

7 0
2 years ago
What is a different paragph formatting tools
soldi70 [24.7K]
You can have paragraph alignment which is left, right, and center
5 0
3 years ago
A hockey stick hits a puck on the ice. identify an action-reaction pair in this situation.
Alika [10]
The stick exerts a force on the puck; the puck exerts a force on the stick.
7 0
3 years ago
Which of the following is NOT a period of the Middle Ages?
frez [133]
High middle ages is the answer
5 0
3 years ago
Other questions:
  • To decrease the size of text so it will fit into a text box without overflowing, select the
    14·2 answers
  • If you want to use your computer for recording your band, you would benefit most from a(n)
    13·2 answers
  • In Florida, you can drive a motorcycle if you have a _____.
    8·1 answer
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    13·1 answer
  • How can i become an ailen?
    5·2 answers
  • Can an iphone user see when an android user is typing
    10·2 answers
  • All of the following are characteristics of a 4 year college except
    11·2 answers
  • क) मानौं तिमी बसेको समाजमा मान्छेहरूले सधै फोहर फाल्ने गर्नाले वातावरण प्रदूषित
    13·1 answer
  • Part 2: Code the Program
    12·1 answer
  • I need a computer science help.....and I rlly want it right now...this the question
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!