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
jek_recluse [69]
2 years ago
6

Consider the classes below: public class TestA { public static void main(String[] args) { ​ int x = 2; ​ int y = 20 ​ int counte

r = 0; ​ for (int j = y % x; j < 100; j += (y / x)) { ​ counter++; ​ } } } public class TestB { public static void main(String[] args) { ​ int counter = 0; ​ for (int j = 10; j > 0; --j) { ​ ++counter; ​ } } } Which of the following statements is true?a. The value of j will be the same for each loop for all iterations b. The value of counter will be different at the end of each for loop for each class. c. Both A and B are true. d. Neither A nor B is true.
Computers and Technology
1 answer:
grigory [225]2 years ago
3 0

Answer:

The answer is "Option d".

Explanation:

In the given code, two class "TestA and TestB" is defined, that calculates some values which can be described as follows:

  • In class "TestA", three integer variable "x, y, and counter" is declared, that initializes with a value, that is "2, 20, and 0", inside the class for loop is declare that uses variable j which starts from and ends when the value of j is less than 100, it will increment the value of counter variable by 1.
  • In the class "TestB", an integer "counter" variable is initializes a value with 0, inside the class the for loop is used that uses variable j, which starts from 10, and ends when j is less than 0. in the loop it increments the value of "counter" variable by 1.  that's why in this question except "option d" all were wrong.

You might be interested in
What actions might contribute to recommendations you see online?
Virty [35]

Answer: what you search up

8 0
1 year ago
Implemente a função ao lado, que recebe um preço e um booleano indicando se já está com desconto ou não. Se o preço for maior qu
Andrew [12]

Answer:

function pecoDesconto(preco, estaComDesconto) {

 

 let p = preco;

 let desconto = estaComDesconto;

 if(p > 100 && desconto == false){

   return "Quero pechinchar";

 }else{

   return "Negócio fechado";

 }

}

Explanation:

function pecoDesconto(preco, estaComDesconto) {

 

 // Implemente a função ao lado, que recebe um preço//

 let p = preco;

// variavel que indica desconco//

 let desconto = estaComDesconto;

//Se o preço for maior que 100 e não estiver com desconto, a função deve retornar Quero pechinchar.//

 if(p > 100 && desconto == false){

   return "Quero pechinchar";

   //Caso contrário, deve retornar Negócio fechado

 }else{

   return "Negócio fechado"

 }

}

só te faltou ler com atenção, e um pouco de logica!

7 0
2 years ago
Who was the founder of the location-sharing site Whrrl
Lilit [14]
By Pelago, INC. Founders of Pelago are: Jeff Holden<span> and </span><span>Darren Vengroff.</span>
3 0
3 years ago
How to print<br> 1<br> 321<br> 54321<br> 7654321<br> triangle pattern in python
krok68 [10]

Hope this helps, Upvote if you like it :)

6 0
2 years ago
​Microsoft claims that the microsoft project software can _____.
Lina20 [59]
The Microsoft project software is designed in assisting the project manager in formulating plans, distributing resources to certain tasks, progress monitoring, budget management and analysis of workloads.

I hope I was able to help you. Thank you for posting your question here at Brainly.
8 0
3 years ago
Other questions:
  • A customer states that when she removes the printed pages from her laser printer output tray, the black ink smears all over her
    10·1 answer
  • Identify the correct software or hardware applications in the passage below
    10·1 answer
  • A programmer wrote the code segment below to display the average of all the elements in a list called numbers. There is always a
    8·1 answer
  • What process improves the life of a computer
    11·1 answer
  • Andy, a developer, is designing a new program. Which tool should Andy use to help him complete his task?
    13·1 answer
  • What is the name of the advanced warrior race of robots in Doctor Who?
    10·2 answers
  • This assignment will again take the form of a compare/contrast essay. You will use the fresco of Christ Teaching the Apostles in
    14·1 answer
  • Write a program using for loop to find the cube of numbers from 50-100 <br> FASTT
    11·1 answer
  • Type of cable installed on a patch panel?
    15·1 answer
  • The action of entering data into your computer. This can be text typed in a word processing document, keywords entered in a sear
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!