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
Crazy boy [7]
3 years ago
10

How many times is the text "Let's have fun with Java." printed when this code snippet is run? int i = 0; do { System.out.println

("Let's have fun with Java."); i++; if (i % 2 == 0) { i = 10; } } while (i <= 10);
Computers and Technology
1 answer:
mash [69]3 years ago
8 0

Answer:

The above code print the text at three times.

Explanation:

  • It is because the above code has one loop which executes three times. The loop executes for the value of i = 0,1 and 10.
  • when the value of i is 0 then "++i" will increase the value 1 and the text will be printed.
  • If the value of i=1, then the value of i is 2 in the second iteration and the again the text is printed, then the if condition gives the true result and the value of i will be 10.
  • Then the loop executes for the last time when the value of i is 10.Then the value will be 11 because of the increment operator and the text will be printed for the third time.
  • Then the while loop is not true for the 11 value of i and the loop will get terminated.
You might be interested in
Which implementation has the worst time complexity?
Nata [24]

Answer:

China and Michigan hskbvd

8 0
3 years ago
A byte in memory is identified by a unique number called its
Murrr4er [49]
It is identified by its address number.
4 0
3 years ago
Everybody at a company is assigned a unique 9 digit ID. How many unique IDs exist?
Brut [27]
If you include all zeroes, then it should be 1,000,000,000. Otherwise it’s 999,999,999.

Think of how between 0-9 theres 10 numbers, and use that logic towards 000000000-999999999
3 0
3 years ago
A virus has attacked your hard drive. Instead of seeing the Windows Start screen when you start up Windows, the system freezes a
Yanka [14]

Answer:

Boot to safe mode

Explanation:

When a virus attacks boot system, that is to say, Windows program won´t load. The following steps should be considered taking into account what Windows Version is being used, Windows 7, 8 or 10:

1. Press  F8 (Windows 7) F4 (Windows 8, 10)

2. Enable Safe Mode

3. Run Safe Mode

4. Once in safe mode the user will have access to Windows and eventually document files can be extracted via pendrive.

5 0
3 years ago
Insurance can help you:
Blababa [14]
No it can not .............
3 0
3 years ago
Other questions:
  • Mark, David, Tia, and Ashley are team members in a computer programming class. They have been assigned the task of creating a co
    12·1 answer
  • Consider a multiprocessor CPU scheduling policy. There are 2 options: 1) a singlecommon ready queue of jobs; when a CPU becomes
    8·1 answer
  • You have found an old dusty computer in your basement that you can identify as an original IBM PC. You ask your friend if he kno
    13·1 answer
  • What is the value of length after the code that follows is executed?int[][] nums = { new int [] {1, 2, 3},new int [] {3, 4, 5, 6
    8·1 answer
  • Columns are most useful for which tasks ?
    12·1 answer
  • (70 points) This is a legit question that I have for a device FOR my homework.
    5·2 answers
  • A newspaper wants to estimate the proportion of Americans who will vote for Candidate A. A random sample of 1000 voters is selec
    14·1 answer
  • Write a function definition for a function which takes one parameter and returns twice that parameter
    12·1 answer
  • Mô tả những lợi ích của việc sử dụng đa xử lý không đồng nhất trong một hệ thống di động
    8·1 answer
  • 40 points for this question
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!