Question: 4 WSWhile Loop Loops-Chapter Trace the following loops with columns for each variable output. Write compile error, runtime error or infinite loop whe appropriate. Name:Autato

 4 WSWhile Loop Loops-Chapter Trace the following loops with columns for
each variable output. Write "compile error", "runtime error" or "infinite loop" whe
appropriate. Name:Autato show the variable values output while (num -5 66 dum
19) break; num++; System.out.println (num) i Loops-Chapter 4- S- Intra-Age1r Nested Loops

4 WSWhile Loop Loops-Chapter Trace the following loops with columns for each variable output. Write "compile error", "runtime error" or "infinite loop" whe appropriate. Name:Autato show the variable values output while (num -5 66 dum 19) break; num++; System.out.println (num) i Loops-Chapter 4- S- Intra-Age1r Nested Loops Name : Show the output produced by the following segments of code. Assume that all variables are declared as int. 1. for (int k 0: k -4; d--) System.out.println(d+ " "+ e)i 3. x = 0; while (x = 1 ; j-= 2) System.out.printin (j); 5. for (i = 0 ; i 0; value--) |-systen.ou t_printintvalue); for (int value-li value> 20; value+-4) System.out.println (value) i For exercises 7 to 10, write code segments that will perform the specified action. EXAMPLE: Read and print values entered by a user until a particular sentinel value is encountered. Do not print the sentinel value. Assume the sentinel value is stored in a constant called SENTINEL. System.out.print ("Enter a value:") int value-. Integer.parseInt(num); while (value!-SENTINEL) System.out.println (value) ; System.out.print ("Enter another value:") value Integer. Parse int (num); 7. Verify that the user enters a positive value. (use a while loop) 8. Verify that the user enters an even value (use a do loop) 9. Read values from the user, quitting when a sentinel value of 0 is entered. Compute and print the product of all values entered (excluding the sentinel value). 10. Print the odd numbers between 1 and 100

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!