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
How long does it take to get your alignment fixed?
GarryVolchara [31]
This isn't a computer-related question...

But, lucky for you, I took some automotive in high school. Usually, it depends on equipment used and how many clients they have. Usually, it is done within an hour. 
8 0
3 years ago
CPU BENCHMARKS are measurements used to compare performance between processors
Troyanec [42]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

CPU benchmarks are used to picking the best CPU. If you want to pick the best CPU for the kind of work you do is easier if you research some performance benchmarks.

As you know, CPU benchmarks are measurements used to compare performance between processors. These benchmarks are the measure to know the performance of CPU.

These CPU Benchmarks are generated by running software programs specifically designed to push the limits of CPU performance.

3 0
3 years ago
What permission do users have by default regarding printer access and the ability to manage documents?
Gnesinka [82]
<span>You can view documents across all print queues and print devices.

</span>
8 0
2 years ago
Hexadecimal to denary gcse method
Anuta_ua [19.1K]

There are two ways to convert from hexadecimal to denary gcse method. They are:

  • Conversion from hex to denary via binary.
  • The use of base 16 place-value columns.

<h3>How is the conversion done?</h3>

In Conversion from hex to denary via binary:

One has to Separate the hex digits to be able to know or find its equivalent in binary, and then the person will then put them back together.

Example - Find out the denary value of hex value 2D.

It will be:

2 = 0010

D = 1101

Put them them together and then you will have:

00101101

Which is known to be:

0 *128 + 0 * 64 + 1 *32 + 0 * 16 + 1 *8 + 1 *4 + 0 *2 + 1 *1

= 45 in denary form.

Learn more about hexadecimal from

brainly.com/question/11109762

#SPJ1

3 0
2 years ago
Design and write a class that implements an ordered list type using a linked list, and a program that exercises and tests the cl
-Dominant- [34]

Answer:

A

Explanation:

7 0
3 years ago
Other questions:
  • Write the definition of a function printAttitude , which hasan int parameter and returns nothing. The function prints amessage t
    13·1 answer
  • Advertising is organized around four distinct groups. The _____ group includes the photographers, the illustrators, video produc
    9·1 answer
  • Websites whose URL’s contain tildes (~) are usually published by the government. TRUE or FALSE.
    8·2 answers
  • Problem 5. (Greatest Common Divisor) Write a program gcd.py that accepts p (int) and q (int) as command-line arguments, and writ
    13·1 answer
  • What is the difference between edge and core networks?
    13·1 answer
  • What is Java Script?
    13·1 answer
  • Define a function UpdateTimeWindow() with parameters timeStart, timeEnd, and offsetAmount. Each parameter is of type int. The fu
    10·1 answer
  • Consider the following code snippet:
    13·1 answer
  • Help a brotha out..................
    10·1 answer
  • Henry wants to create a presentation for his clients. He wants to upload the presentation file directly to the Internet. Which p
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!