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
8

/*

Computers and Technology
1 answer:
Lera25 [3.4K]3 years ago
4 0

Answer:

The answer to this question can be given as:

Method:

public static void showTwos(int number)  //method definition.

{

method body.  

System.out.print(number + " = ");  //print number

while (number % 2 == 0)   //condition

{

System.out.print("2 * ");    //print message.

number = number / 2;

}

System.out.println(number);    //print value.

}

Explanation:

In the above method definition firstly, we declare the method showTwos() that name is already given in the question then we pass a variable number as a parameter in the method. In this first, we take input number from the user and pass into this method. In this method we use a while loop it is an entry control loop in this loop first we modules the number if it is equal to 0.Then we divide the number by 2 and in the last, we print the value.

You might be interested in
What impact does unemployment have on the economy?
Kazeer [188]

Answer:

<h2>A negative impact.</h2>

Explanation:

The unemployed are also unable to purchase as many goods, so will contribute to lower spending and lower output. A rise in unemployment can cause a negative multiplier effect.

8 0
3 years ago
Read 2 more answers
What trade-offs do you think engineers make between functionality, safety and aesthetics when building a real bridge?
elena55 [62]
Deciding where it should go
6 0
3 years ago
Write a class called MagicSquare, which contains a single method called check that accepts a two-dimensional array as an argumen
ira [324]

Answer:

public class MagicSquare {

   public static void main(String[] args) {

       int[][] square = {

               { 8, 11, 14, 1},

               {13, 2, 7,12},

               { 3, 16, 9, 6},

               {10, 5, 4, 15}

       };

       System.out.printf("The square %s a magic square. %n",

               (isMagicSquare(square) ? "is" : "is not"));

   }

   public static boolean isMagicSquare(int[][] square) {

       if(square.length != square[0].length) {

           return false;

       }

       int sum = 0;

       for(int i = 0; i < square[0].length; ++i) {

           sum += square[0][i];

       }

       int d1 = 0, d2 = 0;

       for(int i = 0; i < square.length; ++i) {

           int row_sum = 0;

           int col_sum = 0;

           for(int j = 0; j < square[0].length; ++j) {

               if(i == j) {

                   d1 += square[i][j];

               }

               if(j == square.length-i-1) {

                   d2 += square[i][j];

               }

               row_sum += square[i][j];

               col_sum += square[j][i];

           }

           if(row_sum != sum || col_sum != sum) {

               return false;

           }

       }

       return d1 == sum && d2 == sum;

   }

}

5 0
3 years ago
Which of the following is a valid byte?<br><br> 11100<br> 11011011<br> 00000000<br> 10022011
SVETLANKA909090 [29]

Answer:

11011011

00000000

Explanation:

10022011 cant be an answer because bits are composed of 0s and 1s

and 11100 is too small.

3 0
2 years ago
A __________ network is good for connecting computers over boundaries. A)campus area
zmey [24]
I believe the answer is D)system area <span />
8 0
4 years ago
Other questions:
  • Use System.DateTime along with System.Console to implement a simple C# program that does the following:_______.
    5·1 answer
  • If you know about 3D printers could you help me fix mine?
    8·1 answer
  • How can you logout your account and do not want to have this anymore
    12·2 answers
  • Que son los sistemas de control con retroalimentacion
    10·1 answer
  • How did punch cards improve the weaving process?
    11·1 answer
  • Exercise 2.14.4: Geometry 2.0
    6·1 answer
  • Which two statements are true about algorithms?
    15·2 answers
  • 1. What are the advantages and disadvantages of technology in communication?
    9·2 answers
  • TASK 1. JUMBLE ME! Direction: Arrange the jumbled letters to form a word. 1. PEREAM 2. RRENT CU 3. METREMO H 4. TORSISER 5. TANC
    10·1 answer
  • Steps to copy and paste text/information from website to Ms-word using keyboard​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!