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
Ne4ueva [31]
4 years ago
15

public class Ex0506 { public static void main (String args[]) { int x = 2; while (x < 10) { if (x % 2 == 0) x+=3; else x+=2;

} System.out.println("x = " + x); } }
Computers and Technology
1 answer:
olga nikolaevna [1]4 years ago
5 0

Answer:

It will print x = 11

Explanation:

x starts with a value of 2 and goes inside the while loop. The loop will continue until x<10. Inside the loop, If x is even number, 3 will be added to x. Otherwise, 2 will be added. When the loop is done, x will be printed.

First iteration:

x = 2, x becomes x + 3 = 5, Is x smaller than 10? YES

Second iteration:

x = 5, x becomes x + 2 = 7, Is x smaller than 10? YES

Third iteration:

x = 7, x becomes x + 2 = 9, Is x smaller than 10? YES

Forth iteration:

x = 9, x becomes x + 2 = 11, Is x smaller than 10? NO

Stop the loop and print x

You might be interested in
Name three output devices
san4es73 [151]

Monitor

Printers

Plotters.

8 0
3 years ago
Describe two measures you can use to evaluate whether an attachment in a message is reliable to open.
meriva
<span>If a attachment is not reliable to open, terrible effects can happen, peradventure it may have a virus or even malware that can destroy a computers software. 

To avoid this and stay on the safe side, try the following:-

- Open it in protected view 
- Do not save the attachment on your computer 
- Look at the author and read the message carefully to make sure it is not biased. 
- Open it on a flash-drive </span>
8 0
3 years ago
Read 2 more answers
PLS HURRY!!<br> Look at the image below!
Lady_Fox [76]

Answer:

Line 2: for numF in [3, 5]

Line 1: for numE in [2, 6]

Line 3: print(numE, numF)

Explanation:

From the outputs, the first number of the first output is 2. This means that <em>numE in [</em><em>2</em><em>, 6]</em> would be on the first line.

The second number of the first output is 3, concluding that <em>numF in [</em><em>3</em><em>, 5]</em> is within a nested loop, meaning it would be on the second line.

This leaves <em>print(numE, numF)</em> on line 3.

We can go through the lines step by step to check if we have placed them in the correct order:

Code

for numE in [2, 6]:

 for numF in [3, 5]:

   print(numE, numF)

During the first iteration, numE = 2 and numF = 3.

Output: 2, 3

Since [3, 5] is in a nested loop, we need to finish iterating all of its numbers before numE moves to the next number, so:

numF moves to 5, numE stays at 2.

Output: 2, 5

Since we have finished iterating through [3, 5], numE moves to 6 and numF starts back at 3:

Output: 6, 3

numE still stays at 6 and numF iterates to 5 since [3, 5] is in a nested loop:

Output: 6, 5

The outputs match the outputs on the sheet, meaning we have correctly placed the code in order.

Hope this helps :)

5 0
3 years ago
What are 3 important reasons to reconcile bank and credit card accounts at set dates?
Karo-lina-s [1.5K]

Answer:

To verify transactions have the correct date assigned to them.

To verify that an account balance is within its credit limit.

To verify that all transactions have been recorded for the period.

Explanation:

7 0
3 years ago
In the following code fragment, how many times is the count() method called as a function of the variable n? Use big-O notation,
ahrayia [7]

Answer:

The loop counts the count() function length of n-1 times with respect to n.

Explanation:

The first and outer loop counts for two times as the variable declared in the condition counts before the iteration is made. The same goes for the other for statements in the source code.

The n represents the number length of a range of numbers or iterables (like an array).

4 0
3 years ago
Other questions:
  • What are some examples of options you can control in the Adjust group to affect an image? (Multiple Choice)
    12·2 answers
  • A website updated daily could be considered _____. a. authoritative b. objective c. accurate d. timely
    8·1 answer
  • Ok so sometimes when i do something i see a box with a question mark in it, how do i remove it, i am on a macOs High Sierra earl
    11·1 answer
  • Use the SAS dataset insure to create a dataset, work.insure10, that (a) only reads in the variables Name, Policy, Company, PctIn
    9·1 answer
  • What does the following code print out? (10 points) int[] array = { 1, 4, 3, 6, 8, 2, 5}; int what = array[0]; // scan the array
    14·1 answer
  • Use the ______ attribute to configure the browser to render default table and table cell borders.
    12·1 answer
  • escribe and explain at least three improvements you think came about with the introduction of intrusion prevention technology. J
    10·1 answer
  • Who is your favorite smite god in Hi-Rez’s “Smite”
    14·1 answer
  • If ADD = 81, BAD = 49, and CAD = 64, then what is the value of ACA?
    14·1 answer
  • What are the 3 main colors for a computer screen?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!