Question: 1) When would it be appropriate to use a while loop? 2) What is a sentinel value in terms of loops? 3) What is the

1) When would it be appropriate to use a while loop?

2) What is a sentinel value in terms of loops?

3) What is the difference between a while loop and do while loop?

4) Write a java code that prints out the numbers 1 - 100 using a while loop.

5) How many times will the following code print out the string "Awesome!"

int count1 = 20;

while (count1 >= 0)

{

int count2 = 40;

while (count2 > 20)

{

System.out.println("Awesome!");

count2--;

}

count1--;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!