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]
4 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]4 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
How would you define the term technology
ivanzaharov [21]
Technology is a way that most people are communicating now a days, whether it be with a phone, computer, etc. It’s is also how businesses can do things like making ad’s.

Not great at explaining things but you can probably make it sound a lot better by adding in your own word!
5 0
3 years ago
The Chairman of the Federal Reserve &amp; the Federal Open Market Committee determine the percentage of a deposit which must be
Scrat [10]
Required Deposit Reserve
6 0
4 years ago
List the four types of computer cases
nignag [31]

Answer:

full-tower, mid-tower, mini-tower, and SFF(Small Factor Form).

I hope it helps.

3 0
3 years ago
Read 2 more answers
How to take screenshots on a lenovo t440p?
dybincka [34]

hold doen your power butten and volume butten


5 0
4 years ago
Objects of the BankAccount class require a name (string) and a social security number (string) be specified (in that order)upon
Maksim231197 [3]

Answer:

import java.util.Scanner;

class BankAccountTest {

       public static void main(String[] args) {

           String name;

           String ssn;

           Scanner in = new Scanner(System.in);

// Receive User input

           System.out.println("Enter Your Name");

           name = in.nextLine();

           System.out.println("Enter Your Social Security Number");

           ssn = in.nextLine();

//Creating an object class BankAccount

           BankAccount newAccount = new BankAccount(name,ssn);

         

       }

   }

Explanation:

Using Java Programming Language

Use Scanner class to read values for name and social security numbers and store in the respective varibles

Make an object of the class BankAccount and supply to values to constructor call

Assume that the class BankAccount exists with the member feilds for name and ssn as below:

<em> public class BankAccount{</em>

<em>   //Class member variables</em>

<em>    private String name;</em>

<em>    private String ssn;</em>

<em>//Constructor</em>

<em>     public BankAccount(String name, String ssn) {</em>

<em>         this.name = name;</em>

<em>         this.ssn = ssn;</em>

<em>     }</em>

<em> }</em>

4 0
3 years ago
Other questions:
  • Where can you access email accounts on your windows 7 computer in order to modify current accounts or create new ones?
    5·1 answer
  • The user interface design principle that places an emphasis on the intuitive flow of the interface (i.e. left to right and top t
    12·1 answer
  • Gn to be printed at a commercial printer. Which main ink type's exact color appearance is determined by the printer and requires
    13·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • Janis is preparing a financial document. She needs to use the dollar symbol placed above the number key 4. Which key will Janis
    14·1 answer
  • 5. The value of a variable
    7·1 answer
  • If a switch needs to send information to other switches in the network it would send out a ___________.
    7·2 answers
  • Which of the following is not one of the four criteria for evaluating websites?
    15·1 answer
  • 849 352 768 493 527 sequence
    9·1 answer
  • How could a game development team use measures of things like blood pressure, brain waves, eye movement, and even electrical con
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!