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]
3 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]3 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
The best way to achieve stronger encryption is to
AnnyKZ [126]

Answer:

Use the NIST standards!

Explanation:

- A larger key size helps, but it depends what the underlying algorithm is, so this is not in itself a solution.

- Some block ciphers are not strong.

- Hardware acceleration will only produce a result faster, not increase the strength of the encryption.

4 0
4 years ago
What function returns a line and moves the file pointer to the next line?
Aneli [31]
The goto command

for example


:start

title ""graphing calculator""

goto start
5 0
3 years ago
What is wrong with each of the following code segments? int[] values; for (int i = 0; i &lt; values.length; i++) { values[i] = i
tino4ka555 [31]

Answer:

values have been declared but not initialized nor allocated memory. So you are not allowed to use "values.length"

7 0
2 years ago
One item you will NOT need to provide when opening up a bank account
gladu [14]

Answer:

You don't need a birth certificate

Explanation:

8 0
3 years ago
Read 2 more answers
What are the benefits of maintaining your vehicle?
Katarina [22]
<span>The correct answer is D - all of the above. It's important to maintain a vehicle to keep it road-worthy for as long as possible without compromising fuel economy, environmental impact or safety. It may also be a legal requirement.</span>
3 0
3 years ago
Read 2 more answers
Other questions:
  • In what ways us cyberspace is real? list at least 3 examples to support your response .
    9·1 answer
  • Write a method so that the main() code below can be replaced by the simpler code that calls method mphandminutestomiles(). origi
    14·2 answers
  • An administrator has noticed that GPO containing new update settings has not yet applied to one of the computers on the network.
    5·1 answer
  • Create a style rule for the page body that sets the width to 95% of the browser window ranging from 640 pixels up to 960 pixels.
    11·1 answer
  • In general, digital to analog modulation equipment is less expensive than the equipment for encoding digital data into a digital
    8·1 answer
  • The name of a person their address and their contact information like phone number and email address or consider the minimum inf
    9·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • If you double the force of and object what happens to the acceleration
    10·1 answer
  • When trying to upload assignment on canvas wont let me click choose file.
    6·1 answer
  • Which discipline focuses on the design of computer hardware?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!