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
What are the main components of a desktop PC and briefly describe their purposes.​
Norma-Jean [14]

Answer:

8 Standard Computer Components and What They Do

Explanation:

Motherboard. The motherboard is an important computer component because it’s what everything else connects to!

Power Supply. True to its name, the power supply powers all other components of the machine.

Central Processing Unit (CPU)

Random-access Memory (RAM)

Hard Disk Drive / Solid State Drive.

Video Card.

Optical Drives.

6 0
2 years ago
Porque sophia es un robot mujer?
gregori [183]
Sophia es un robot humanoide (ginoide) desarrollado por la compañía, con sede en Hong Kong, Hanson Robotics. Ha sido diseñada para aprender, adaptarse al comportamiento humano y trabajar con estos satisfactoriamente.
7 0
3 years ago
Instead of starting with a blank PowerPoint presentation, you can use a __________.
Nuetrik [128]
You can use a Template. :)
8 0
3 years ago
Read 2 more answers
WHO GIVE THE CONCEPT OF INTERNET?
viktelen [127]
Google, Apple, or even Dell
6 0
3 years ago
Jamie found the ISBN of the book she wanted to order in the Books in Print Catalog. To remember the eleven-digit number, 1977255
algol13

Answer:

Chunking

Explanation:

Chunking refers to the process of taking individual pieces of information (called chunks) and grouping them into larger units. By grouping each piece into a large whole, you can improve the amount of information you can remember.

5 0
3 years ago
Other questions:
  • Which of the following is important to do when downloading a game to your
    8·1 answer
  • How do you adjust the shear of a shape?
    10·2 answers
  • What is the purpose of the chart feature in word?
    15·1 answer
  • What are some ways tables can be inserted into a document? Check all that apply.
    5·2 answers
  • For your biology class, you have taken a number of measurements for a plant growth experiment. You wish to create a chart that s
    10·1 answer
  • Please help!!
    8·1 answer
  • How would you copy all files from a remote directory into your LOCAL home folder.
    6·1 answer
  • Which software application offers a variety of templates for creating reports, flyers, and newsletters that you can access withi
    12·1 answer
  • Anne wants to hide her age by converting it from 13 to 1101. Which number system is Anne converting to?
    13·1 answer
  • Sample outputs with inputs 9 5 2 -1 in python.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!