Consider the classes below: public class TestA { public static void main(String[] args) { ​ int x = 2; ​ int y = 20 ​ int counter = 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.

Answers

Answer 1
Answer:

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.


Related Questions

what is optimal page replacement algorithm? (a) replace the page that will not be used for a long time (b) replace the page that has been used for a long time (c) replace the page that has not been used for a long time (d) replace page not in memory (e) used to extract page in main memory
What are at least 4 things you learned about social media ethics? Is there anything you will change after going over this lesson?
Which of the following statements about variables or values are true? Check all that apply.Variables store values.Variables store permanent data.Values are the result of functions.Variables in code are useful only on a single occasion.
A network administrator for a small company is contemplating how to scale the network over the next three years to accommodate projected growth. Which three types of information should be used to plan for network growth? (Choose three.)A. human resource policies and procedures for all employees in the companyB. documentation of the current physical and logical topologies *C. analysis of the network traffic based on protocols, applications, and services used on the network*D. history and mission statement of the companyE. inventory of the devices that are currently used on the network*F. listing of the current employees and their role in the company
Describe the types of digital cameras, how they store captured images, and how to transfer photos to a computer.

Which element of presentation software can you use to add callouts and banners?

Answers

1.)From the Insert tab, select the Shapes command. A drop-down menu will appear.
2.)Select the desired shape
3.)
Click and drag the slide to create the shape. You may need to move or resize the shape so it points to the desired part of the image.
4.)
f you want your callout to contain text, start typing while the shape is selected.
5.)
From the Format tab, you can use the options in the Shape Styles group to customize the appearance of the shape. You can also adjust the font from the Home tab

the answer i can confirm is Shapes

You are compiling information from multiple sources. In addition to applying the standard markings, is there any information specific to compilation that need to be applied?

Answers

Answer:

Yes, include an explanation for the basis of compiled classification

Explanation:

In marking of classified information, the basis of classification is needed to be explained to justify the classification. This is very important in making sure that the information is easy to understand by whosoever is the reader. Marking gives the information holder details on what protection requirement the information holds.

When you take a multiple-choice test, you are relying on ________, a means of retrieving information out of your long-term memory storage system that helps you choose the correct answer. A. encoding
B. recognition
C. storage
D. the Stroop effect

Answers

Answer:b)Recognition

Explanation: Recognition method is the technique which is based upon the similarity of the structure.It basically compares between the received format and the format of the reference on the basis of their structure.It is considered as a good method of the retrieving the image or format which is in storage. This usually results in opting the correct answer or option.

Therefore, the correct answer is option (b).

Document _____ are the details about a file.

Answers

Document Properties as i think

In the end, businesses that use teams tend to have ______.

Answers

Answer:More profit

Explanation:  

Profit is known to be monetary gain which an individual or organisation get or received from a business deal or transaction. Furthermore, it is the reward received after deducting the total revenue from total cost. Thus, businesses that use teams tend to have higher profit because the employees are many and they will bring more customers to transact business with the organisation thereby leading or resulting to more and greater profit or gain.

Usually have more profit. Since teamwork will boosts a business, then they will gain a lot more profit than a person alone. 

Miles has initiated a scam in which he counterfeits a well-known banking website and sends out e-mails to direct victims to it. By making this website look authentic, he is able to get victims to reveal their social security numbers, bank account numbers, and credit card numbers. What type of scam is Miles running in this scenario?

Answers

Answer: Phishing

Explanation: Phishing is a cybercrime or scam whereby targets are made to reveal their personal information like login details, credit card numbers and other confidential things by sometimes sending them emails that are supposedly from their service providers like their banks, requesting for these things to enable them make some "corrections" in their accounts, whereas the information obtained is just to steal or defraud them of their money and valuables.

Phishing is a type of social engineering attack often used to steal user data, including login credentials and credit card numbers. Like i earlier states, it occurs when an attacker, masquerading as a trusted entity, dupes a victim into opening an email, instant message, or text message just for the purpose of scamming them and defrauding them. This is exactly what Miles from the question is doing.

Other Questions