AYDJavaMidterm xYg cuny > STUDENTS.xYContent-2016 Sp D R Arithmetic operat c++ p
ID: 3679298 • Letter: A
Question
AYDJavaMidterm xYg cuny > STUDENTS.xYContent-2016 Sp D R Arithmetic operat c++ pls help with the c filegator C Home | Chegg.com × x x alidas3.tripod.com/iavamidterm.htm 5. A static variable represents classwide information that's shared among the class's objects Multiple Choice Identiy the choice that best completes the statement or answers the question. 6. Identify and correct the errors in the following statements lime1) if c7) line 2) System.out.println"c is less than 7"); initialize variable c before use remove semicolon on line 1 a. C. No errors to correct d. Use System.out.printf on line 2 What is the output of this program? int a= 7, b= 13, c= 23; int sum= 0; for( int i=0; i-25; i++) System.outprintln(sum); c. No output is diplayed d. a. 670 675 S. What is the output of this code? boolean z false; String true; if (xExplanation / Answer
5. True.
6. As this is a code snippet, there is syntactically, no error in the code. It could be choice c.
When logically speaking, it could be choice b. If you remove semicolon there, the print statement will be executed on if c is less than 7. As a whole, a could also be the choice, as c should be initialized before its usage.
7. d. 675 is the answer.
8. a. 23false is the answer.