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 can you make sure that your private information<br> stays private?
Olegator [25]

Answer:

Be Alert to Impersonators. Safely Dispose of Personal Information. Encrypt Your Data. keep Passwords Private. Don't Overshare on Social Networking Sites.

Use Security Software. Avoid Phishing Emails.

Be Wise About Wi-Fi.

3 0
3 years ago
When you use filter by form to restrict records that appear, you create the filter and then click the ____ button to apply the f
AlexFokin [52]
<span>When you use filter by form to restrict records that appear, you create the filter and then click the Toggle Filter button to apply the filter.
</span><span>This button is located in the Sort & Filter group on the Home tab.
</span><span>The Toggle Filter is used to switch between the filtered and unfiltered views.</span>
4 0
3 years ago
write an algorithm that gets two values: the price for item A and the quantity purchased. The algorithm should then print the to
pochemuha

Answer:

Explanation:

price = eval(input("price of item: "))

quantity = eval(input("quantity of item: "))

sales_tax = 0.08 # 8% sales tax

total_cost = price*quantity

total_cost_with_tax = total_cost + total_cost*sales_tax

print("total cost: "+str(total_cost))

print("total cost + 8% sales tax: "+str(total_cost_with_tax))

5 0
4 years ago
National Computer Corporation (NCC) employs Cynthia as an agent. NCC gives her an exclusive territory in which to sell NCC produ
LuckyWell [14K]

Answer:

The answer is cooperation

Explanation:

National Computer Corporation (NCC) employs Cynthia as an agent. NCC gives her an exclusive territory in which to sell NCC products. NCC cannot compete with her in that territory under the duty of cooperation

8 0
4 years ago
What is the answer of this Q?
Inga [223]

Answer:

Because of refraction.

Explanation:

Light coming from fish passes through two medium, one is water and another is air. As the density of medium is changing from high to low, the light bends away from the normal. So to the human eyes, the fish appears to be above its actual position.

7 0
3 years ago
Read 2 more answers
Other questions:
  • The equation y=2x+1 represents a function true or false
    11·1 answer
  • [15 points] 3.2 Lesson Practice (holy marry mother of joseph)
    7·1 answer
  • In molecular biology the "alphabet" of genes consists of four chemicals (called nucleotides) represented by the letters A C G T.
    12·2 answers
  • How USB FLASH Drives Store Data? Explain, Maximum 5 linesa
    10·1 answer
  • Once you create a slide show, it is not easy to rearrange things, so you should plan your presentation ahead of time.
    14·1 answer
  • When considering changing the content of a cell which button should you press to leave the cell as it originally was?
    13·2 answers
  • When photographing wildlife, what type of lighting should you use?
    15·2 answers
  • Assignment 1: silly sentences edhesive
    7·1 answer
  • An e-commerce client is moving from on-premise, legacy systems to a cloud-based platform. During the transition, the client is a
    15·1 answer
  • For which three everyday activities do people most typically use computers?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!