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

What are the arguments both for and against the exclusive use of boolean expressions in the control statements in java (as oppos

ed to also allowing arithmetic expressions, as in c++)?
Computers and Technology
1 answer:
sineoko [7]3 years ago
7 0

Reliability is the major argument for the exclusive use of Boolean expressions (expressions that result to either true or false) inside control statements (i.e. if…else, for loop). Results from control statements become reliable because Java has disallowed other types to be used. Other types, like arithmetic expressions in C++ oftentimes include typing errors that are not detected by the compiler as errors, therefore causing confusion.

You might be interested in
Which educational qualification would help a candidate get a job as a computer systems engineer?
Paul [167]

The educational qualification that would help a candidate get a job as a computer systems engineer is D. advanced graduate degree

<h3>What is an Educational Qualification?</h3>

This refers to the certification that shows that a person has completed the core objectives and studies and can be referred to as an expert of a thing.

Hence, we can see that based on the job of a computer systems engineer, the educational qualification that would help a candidate would be an advanced graduate degree as it is the highest possible qualification.

Read more about computer systems engineer here:

brainly.com/question/10418304

#SPJ1

4 0
1 year ago
Assume that getPlayer2Move works as specified, regardless of what you wrote in part (a) . You must use getPlayer1Move and getPla
kakasveta [241]

Answer:

(1)

public int getPlayer2Move(int round)

{

  int result = 0;

 

  //If round is divided by 3

  if(round%3 == 0) {

      result= 3;

  }

  //if round is not divided by 3 and is divided by 2

  else if(round%3 != 0 && round%2 == 0) {

      result = 2;

  }

  //if round is not divided by 3 or 2

  else {

      result = 1;

  }

 

  return result;

}

(2)

public void playGame()

{

 

  //Initializing player 1 coins

  int player1Coins = startingCoins;

 

  //Initializing player 2 coins

  int player2Coins = startingCoins;

 

 

  for ( int round = 1 ; round <= maxRounds ; round++) {

     

      //if the player 1 or player 2 coins are less than 3

      if(player1Coins < 3 || player2Coins < 3) {

          break;

      }

     

      //The number of coins player 1 spends

      int player1Spends = getPlayer1Move();

     

      //The number of coins player 2 spends

      int player2Spends = getPlayer2Move(round);

     

      //Remaining coins of player 1

      player1Coins -= player1Spends;

     

      //Remaining coins of player 2

      player2Coins -= player2Spends;

     

      //If player 2 spends the same number of coins as player 2 spends

      if ( player1Spends == player2Spends) {

          player2Coins += 1;

          continue;

      }

     

      //positive difference between the number of coins spent by the two players

      int difference = Math.abs(player1Spends - player2Spends) ;

     

      //if difference is 1

      if( difference == 1) {

          player2Coins += 1;

          continue;

      }

     

      //If difference is 2

      if(difference == 2) {

          player1Coins += 2;

          continue;

      }

     

     

  }

 

  // At the end of the game

  //If player 1 coins is equal to player two coins

  if(player1Coins == player2Coins) {

      System.out.println("tie game");

  }

  //If player 1 coins are greater than player 2 coins

  else if(player1Coins > player2Coins) {

      System.out.println("player 1 wins");

  }

  //If player 2 coins is grater than player 2 coins

  else if(player1Coins < player2Coins) {

      System.out.println("player 2 wins");

  }

}

3 0
3 years ago
Both IT professionals and governments must apply ethical principles to certify that emerging technologies are to society.
Katarina [22]
The answer is C fair………………………
6 0
2 years ago
You are driving on expressway with three lanes in your direction at a speed lower then
Kaylis [27]

<em>ANSWER:</em>

<em></em>

<h2>Pass on the left<em> </em></h2>

6 0
3 years ago
Read 2 more answers
Suppose an IP packet is fragmented into 10 fragments, each with a 1% (independent) probability of loss. To a reasonable approxim
Marysya12 [62]

Answer:

a. 0.01

b. 0.001

c. The identification field of the packet fragment can be used to uniquely identify and collate the fragments lost in transmission.

Explanation:

The probability of losing a packet is 10% or 0.1, so the probability of losing the packet twice during transmission;

= 0.1 x 0.1 = 0.01

When any fragments have been part of the transmission, the probability of the packet is dependent on the fragments;

= 0.01 x 0.1 = 0.001

The identification field is a unique 16-bit value assigned to an IPv4 packet, when a packet is fragmented for transmission, its field is used to collate the unique fragments in the packet.

6 0
3 years ago
Other questions:
  • Corey is an architect. What software does he most likely use to design houses? graphic software scheduling software CAD software
    10·2 answers
  • Jana keeps receiving friend requests from strangers on a social media site. This is making her uncomfortable.
    15·2 answers
  • What part of a file name does windows use to know which application to open to manage the file?
    13·2 answers
  • What are the first two lines of defense a company should take when addressing security risks?
    10·1 answer
  • Web pages often have built-in connections, or links, to other documents, graphics, other web pages, or web sites. true or false?
    9·1 answer
  • A computer has 9850 processes and 172 of them where suspended while 276 were terminated.,explain why some of the processes where
    15·1 answer
  • Given an array of n distinct integers,d = [d[0], d[1],.., d[n - 1]], and an integer threshold, t, how many (a,b,c) index triplet
    11·1 answer
  • ERP packages are always quite simple.<br><br> True<br><br> False
    5·1 answer
  • What did do you do if you made a mistake on a computer?
    14·2 answers
  • 9.19 LAB: Words in a range (lists) Write a program that first reads in the name of an input file, followed by two strings repres
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!