Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***Ch.5 JAVA*** Chapter 5 Loops 1. How many times will the following code print Welcome to Java? int count =0; while (count >=0){ System.out.printin( Welcome

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

***Ch.5 JAVA***

Chapter 5 Loops 1. How many times will the following code print "Welcome to Java"? int count =0; while (count >=0){ System.out.printin(" Welcome to Java"); \} a. 8 b. 9 c. 10 d. 11 e. infinity 2. What is the output of the following code? int x=0; while (x0){ number =3; System.out.print(number +m ); \} a. 630 b. 63 c. 30 d. 303 e. 0-3 4. What will be the output of the code below when executed"? long num =12356; long result=0; while (num>0)\{ result=result* 10+ num %10; num/=10; System.out.println(result); a. 0 b. 100 c. 123 d. 654321 e. 356 5. What is the value in count after the following loop is executed? int count = 0; do \{ Syste while (coun System.out.p a.b.c.d.e.8910110 System.out.printin("Welcome to Java"); \} while (count++d=0;d10 would always be true. d. The program compiles and runs fine. 8. Which of the following loops correctly computes 1/2+2/3+3/4++99/100 ? A: double sum =0; for (int i=1;i=1;j) System.out.print (j=1;j ) System.out.print (j>=i?j+m=m+n+m ? ; System.out.println(); 19. To add 0.01+0.02++1.00, what order should you use to add the numbers to get better accuracy? a. add 0.01,0.02,,1.00 in this order to a sum variable whose initial value is 0 . b. add 1.00,0.99,0.98,,0.02,0.01 in this order to a sum variable whose initial value is 0 . 20. Analyze the following code, what option describe the cod? double sum = 0 ; for (double d=0;d 4) break; \} while (item =4 ) continue; sum += item; while (item =1 ) \{ if (balance =1 ) \{ if (balance

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago