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]
3 years ago
10

In JAVA,

Computers and Technology
1 answer:
Dahasolnce [82]3 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 the definition of a class Clock. The class has no constructors and three instance variables. One is of type int called hou
maksim [4K]

Answer:

Following are the program definition in the Java Programming Language.

//define a class

public class Clock

{

//set integer type variable and initialize value

private int hours=12;

//set boolean type variable and initialize value

private boolean isTicking=true;

//set integer type variable and initialize value

private Integer diff=5;

}

Explanation:

Following are the description of Code.

  • Firstly define a class "Clock" with the "private" access modifier.
  • Then,  set the integer data type variable "hours" with the "private" access modifier and assign value 12 in that class.
  • After that, set the boolean data type variable "isTicking" with the "private" access modifier and assign value "true".
  • Finally set Integer class variable "diff" with the the private access modifier and assign value 5.
3 0
3 years ago
Which lighting direction is used to create silhouettes
Elena L [17]
The answer is backlighting
5 0
2 years ago
Select the properties of the sn1 reaction mechanism.
musickatia [10]

It is - not stereospecific , a reaction in which the stereochemistry of the reactants controls the outcome of the reaction; - bimolecular at rate-determining step , it involves two molecules; - first order, - rates is governed by the stability of the carbocation that is formed.

7 0
3 years ago
A(an)_______is built-in preset calculation. <br>formula <br> function <br>equation <br>AutoSum​
Yanka [14]

Answer:

Hello! The answer to your question is function I had the same question and got it right!

Explanation:

Hope this helped:)

3 0
3 years ago
What was the first carbonated drink to be introduced in the US?
adelina 88 [10]
Taco bell...........................................................................................................................................................................

6 0
3 years ago
Other questions:
  • Which of the following characters at the beginning of a cell signifies to Excel that it should perform a calculation for the val
    13·1 answer
  • Prompt the user ‘Enter a row vector of any numbers’ in the command window, and enter an arbitrary row vector and store it to x.
    6·1 answer
  • You could be electrocuted if you try to use water to put out a
    14·2 answers
  • Extinction of a species is always a negative impact on the Earth.<br><br> True<br> False
    8·1 answer
  • Which statement best describes the cut and paste option in a word processor?
    6·2 answers
  • How many pieces are there in a normal laptop??? Good luck and solve carefully
    9·1 answer
  • 4. UPS stands for Uninterrupted Power Supply . (Yes /no
    11·1 answer
  • To extract detailed and comprehensive responses from your client, use the _____ questioning technique.
    5·2 answers
  • In order to detect repeated lines anywhere in the input, myuniq must keep track of all of the lines it has seen as it moves thro
    9·1 answer
  • Select all of the reasons Windows 95 increased the popularity of Windows.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!