fork(10) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13. Small logo Program Control
  14. Test 9
  15. When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
  16. Value: 1 point.
  17. Which of the following statements best justifies using a for-each loop in place of a for loop?
  18.  
  19. A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
  20.  
  21. A for loop can't be used on arrays.
  22.  
  23. A for-each loop makes it easier to control the order in which elements of an array are referenced.
  24.  
  25. A for loop generally takes a longer time to execute.
  26.  
  27. A for-each loop compiles to smaller code than a for loop.
  28.  
  29. Test 9 (1)
  30.  
  31. ABCDE CorrectExcellent !!!
  32. Score: 1 / 1
  33. Submitted: Monday, November 4, 2013 9:01am
  34.  
  35. Answer Key
  36. The following model answer has been provided to you by the grader. Carefully compare your answer with the one provided here.
  37. (A) A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
  38.  
  39.  
  40. Consider the following code fragment:
  41.  
  42. int[] r = { 9, 2, 4, 3, 7, 5, 0, 1 };
  43. for ( int t : r )
  44. {
  45. t = t + 1;
  46. }
  47. Value: 1 point.
  48. Which of the following is a true statement?
  49.  
  50. The code will execute and the elements of the array r will be unchanged.
  51.  
  52. The code will execute and each element of the array r will be incremented.
  53.  
  54. The code will execute and each element of the array r will be the sum of the previous elements.
  55.  
  56. The code will execute and each element t of the array r will be the sum of the first t integers.
  57.  
  58. The code will generate an error.
  59.  
  60. Test 9 (2)
  61.  
  62. ABCDE CorrectExcellent !!!
  63. Score: 1 / 1
  64. Submitted: Monday, November 4, 2013 9:08am
  65.  
  66. Answer Key
  67. The following model answer has been provided to you by the grader. Carefully compare your answer with the one provided here.
  68. (A) The code will execute and the elements of the array r will be unchanged.
  69.  
  70. The for-loop assigns the value of each element of r in turn to the loop variable, t. The body of the loop then increments t. This has no effect whatsoever on r. No new values are assigned to its elements.
  71.  
  72.  
  73. Value: 1 point.
  74. What is output by the following code fragment? (You may assume that the for-each loop references the array elements in index order.)
  75.  
  76. String[] p = { "A", "B", "C", "D" };
  77. String b = "";
  78.  
  79. for ( String q : p )
  80. b = q + b;
  81.  
  82. System.out.println( b );
  83.  
  84. "ABCD"
  85.  
  86. "DCBA"
  87.  
  88. "qqqq"
  89.  
  90. "bbbb"
  91.  
  92. "" (the empty string)
  93.  
  94. Test 9 (3)
  95.  
  96. ABCDE CorrectExcellent !!!
  97. Score: 1 / 1
  98. Submitted: Monday, November 4, 2013 9:10am
  99.  
  100. Answer Key
  101. The following model answer has been provided to you by the grader. Carefully compare your answer with the one provided here.
  102. (B) "DCBA".
  103.  
  104.  
  105. Consider the following code fragment:
  106.  
  107. String[] cities = new String[ 10 ];
  108.  
  109. // missing code that inserts a String in each element of this array
  110.  
  111. for ( String city : cities )
  112. {
  113. if ( city.substring( 0, 1 ).equals( "C" ) )
  114. System.out.println( city );
  115. }
  116. Value: 1 point.
  117. Assuming that the above for-each loop references the array elements in index order, which of the following code fragments result in the same output as the fragment above?
  118.  
  119.  
  120. String[] cities = new String[ 10 ];
  121.  
  122. // missing code that inserts a String in each element of this array
  123.  
  124. for ( int i = 0 ; i < cities.length ; i++ )
  125. {
  126. String city = cities[ i ];
  127. if ( city.substring( 0, 1 ).equals( "C" ) )
  128. System.out.println( city );
  129. }
  130.  
  131. String[] cities = new String[ 10 ];
  132.  
  133. // missing code that inserts a String in each element of this array
  134.  
  135. for ( int i = 0 ; i < cities.length ; i++ )
  136. {
  137. if ( cities[ i ].substring( 0, 1 ).equals( "C" ) )
  138. System.out.println( cities[ i ] );
  139. }
  140.  
  141. String[] cities = new String[ 10 ];
  142.  
  143. // missing code that inserts a String in each element of this array
  144.  
  145. int i = 0;
  146. while ( i < cities.length )
  147. {
  148. String city = cities[ i ];
  149.  
  150. if ( city.substring( 0, 1 ).equals( "C" ) )
  151. System.out.println( city );
  152.  
  153. i++;
  154. }
  155.  
  156. I only
  157.  
  158. II only
  159.  
  160. I and II only
  161.  
  162. I, II, and III
  163.  
  164. None of them
  165.  
  166. Test 9 (4)
  167.  
  168. ABCDE CorrectExcellent !!!
  169. Score: 1 / 1
  170. Submitted: Monday, November 4, 2013 9:02am
  171.  
  172. Answer Key
  173. The following model answer has been provided to you by the grader. Carefully compare your answer with the one provided here.
  174. (D) I, II, and III.
  175.  
  176.  
  177. Value: 1 point.
  178. Which of the following statements are true?
  179.  
  180. for loops cannot be used for iterating over arrays.
  181.  
  182. If the elements of an array of Strings are not in alphabetical order, then it is always better to use a for loop when iterating over the elements of the array.
  183.  
  184. All for loops should be replaced by for-each loops.
  185.  
  186. I only
  187.  
  188. II only
  189.  
  190. III only
  191.  
  192. I, II, and III
  193.  
  194. None of them
  195.  
  196. Test 9 (5)
  197.  
  198. ABCDE CorrectExcellent !!!
  199. Score: 1 / 1
  200. Submitted: Monday, November 4, 2013 9:04am
  201.  
  202. Answer Key
  203. The following model answer has been provided to you by the grader. Carefully compare your answer with the one provided here.
  204. (E) None of them.
  205.  
  206.  
  207. Value: 1 point.
  208. What is the value of t after execution of the following code has finished?
  209.  
  210. double[] a = { 3.5, -1.0, 7.8 };
  211. int t = 0;
  212.  
  213. for ( double b : a )
  214. {
  215. t += (int)b;
  216. }
  217. 9
  218.  
  219. 10
  220.  
  221. 11
  222.  
  223. 10.3
  224.  
  225. None of the above — a possible loss of precision error occurs.
  226.  
  227. Test 9 (6)
  228.  
  229. ABCDE CorrectExcellent !!!
  230. Score: 1 / 1
  231. Submitted: Monday, November 4, 2013 9:14am
  232.  
  233. Answer Key
  234. The following model answer has been provided to you by the grader. Carefully compare your answer with the one provided here.
  235. (A) 9.
  236.  
  237. The final value of t is the sum of the results of casting each element of the array a to an int, that is, the sum of 3, −1, and 7.
  238.  
  239.  
  240. Value: 1 point.
  241. What can be said about the value of d after the comment is replaced by an actual initialization statement and the resulting code is executed?
  242.  
  243. String [] a;
  244.  
  245. // code to initialize a
  246.  
  247. boolean d = false;
  248.  
  249. for ( String b : a )
  250. {
  251. for ( String c : a )
  252. {
  253. if ( b.equals( c ) )
  254. d = true;
  255. }
  256. }
  257.  
  258. The value is true, no matter what Strings (if any) the array a contains.
  259.  
  260. The value is false, no matter what Strings (if any) the array a contains.
  261.  
  262. The value is true if a contains a duplicate element; otherwise it is false.
  263.  
  264. The value is false if a contains a duplicate element; otherwise it is true.
  265.  
  266. The value is true if a contains at least one element; otherwise it is false.
  267.  
  268. Test 9 (7)
  269.  
  270. ABCDE CorrectExcellent !!!
  271. Score: 1 / 1
  272. Submitted: Monday, November 4, 2013 9:07am
  273.  
  274. Answer Key
  275. The following model answer has been provided to you by the grader. Carefully compare your answer with the one provided here.
  276. (E) The value is true if a contains at least one element; otherwise it is false.
  277.  
  278. If a contains at least one element, then at some point the outer loop variable b and the inner loop variable c will both reference the same element of a. At that point, the value of b.equals( c ) will be true and so the value true will be assigned to d. Since there is nothing in the code that will ever set this value back to false, the final value of d in such a case will be true.
  279.  
  280. On the other hand, if a contains no elements, then the nested for-each loops result in no activity at all, and the value of d remains in its initial state, that is, false.
  281.  
  282.  
  283. Value: 1 point.
  284. Assuming that the for-each loops reference arrays in index order, what is the output from the following code?
  285.  
  286. int[][] b = { {1,2}, {3,4} };
  287.  
  288. for ( int[] c : b )
  289. for ( int y : c )
  290. System.out.print( y );
  291. 1234
  292.  
  293. 4321
  294.  
  295. 3412
  296.  
  297. 2143
  298.  
  299. There is no output; an error occurs.
  300.  
  301. Test 9 (8)
  302.  
  303. ABCDE CorrectExcellent !!!
  304. Score: 1 / 1
  305. Submitted: Monday, November 4, 2013 4:50pm
  306.  
  307. Answer Key
  308. The following model answer has been provided to you by the grader. Carefully compare your answer with the one provided here.
  309. (A) 1234.
  310.  
  311.  
  312. Value: 1 point.
  313. What is the value of a after the following code executes?
  314.  
  315. double[] g = { 9.2, 7.3, 6.5 };
  316.  
  317. String a;
  318.  
  319. for ( String t : g )
  320. a = t;
  321. }
  322. }
Compilation error #stdin compilation error #stdout 0.07s 380160KB
stdin
Standard input is empty
compilation info
Main.java:13: error: ';' expected
   Small logo Program Control
             ^
Main.java:13: error: ';' expected
   Small logo Program Control
                             ^
Main.java:14: error: not a statement
Test 9
^
Main.java:14: error: ';' expected
Test 9
    ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
        ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                 ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                 ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                            ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                      ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                              ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                         ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                    ^
Main.java:15: error: not a statement
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                     ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                         ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                      ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                     ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                 ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                           ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                    ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                         ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                       ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                   ^
Main.java:15: error: not a statement
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                    ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                            ^
Main.java:15: error: '(' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                              ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                     ^
Main.java:15: error: not a statement
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                      ^
Main.java:15: error: ')' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                          ^
Main.java:15: error: not a statement
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                           ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                             ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                                             ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                                                        ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                                                                   ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                                                                                  ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                                                                                                          ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                                                                                                                    ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                                                                                                                                  ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                                                                                                                                          ^
Main.java:15: error: ';' expected
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                                                                                                                                                      ^
Main.java:15: error: not a statement
When you take the actual Advanced Placement examination, you will have to work with paper and pencil only, without the possibility of running any code with the help of a Java compiler. To prepare yourself for the exam, you should work on this test using only paper and pencil. Complete each question carefully, and press its Submit button to have your answer graded.
                                                                                                                                                                                                                                                                                                                                                                             ^
Main.java:16: error: ';' expected
Value: 1 point.
     ^
Main.java:17: error: ';' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
        ^
Main.java:17: error: ';' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                      ^
Main.java:17: error: ';' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                      ^
Main.java:17: error: ';' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                      ^
Main.java:17: error: not a statement
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                       ^
Main.java:17: error: ';' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                        ^
Main.java:17: error: '(' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                            ^
Main.java:17: error: ';' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                                 ^
Main.java:17: error: ';' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                                      ^
Main.java:17: error: not a statement
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                                       ^
Main.java:17: error: ')' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                                         ^
Main.java:17: error: not a statement
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                                          ^
Main.java:17: error: ';' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                                               ^
Main.java:17: error: ';' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                                                    ^
Main.java:17: error: '(' expected
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                                                        ^
Main.java:19: error: : expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
 ^
Main.java:19: error: illegal start of expression
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
  ^
Main.java:17: error: not a statement
Which of the following statements best justifies using a for-each loop in place of a for loop?
                                                                                             ^
Main.java:19: error: ';' expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
          ^
Main.java:19: error: ';' expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
               ^
Main.java:19: error: not a statement
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                ^
Main.java:19: error: ')' expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                  ^
Main.java:19: error: not a statement
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                   ^
Main.java:19: error: ';' expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                       ^
Main.java:19: error: ';' expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                                    ^
Main.java:19: error: ';' expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                                                ^
Main.java:19: error: ';' expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                                                        ^
Main.java:19: error: ';' expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                                                                    ^
Main.java:19: error: ';' expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                                                                            ^
Main.java:19: error: ';' expected
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                                                                                              ^
Main.java:19: error: not a statement
A for-each loop is more readable and concise and its use will likely lead to fewer programming errors.
                                                                                                     ^
Main.java:21: error: ';' expected
A for loop can't be used on arrays.
 ^
Main.java:21: error: '(' expected
A for loop can't be used on arrays.
     ^
Main.java:21: error: unclosed character literal
A for loop can't be used on arrays.
              ^
Main.java:21: error: ';' expected
A for loop can't be used on arrays.
                ^
Main.java:21: error: not a statement
A for loop can't be used on arrays.
                    ^
Main.java:21: error: ')' expected
A for loop can't be used on arrays.
                        ^
Main.java:21: error: not a statement
A for loop can't be used on arrays.
                         ^
Main.java:21: error: ';' expected
A for loop can't be used on arrays.
                           ^
Main.java:21: error: not a statement
A for loop can't be used on arrays.
                                  ^
Main.java:23: error: ';' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
 ^
Main.java:23: error: '(' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
     ^
Main.java:23: error: ';' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
          ^
Main.java:23: error: ';' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
               ^
Main.java:23: error: not a statement
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                ^
Main.java:23: error: ')' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                     ^
Main.java:23: error: not a statement
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                      ^
Main.java:23: error: ';' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                        ^
Main.java:23: error: ';' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                                  ^
Main.java:23: error: ';' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                                              ^
Main.java:23: error: ';' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                                                       ^
Main.java:23: error: ';' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                                                                      ^
Main.java:23: error: ';' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                                                                            ^
Main.java:23: error: ';' expected
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                                                                                      ^
Main.java:23: error: not a statement
A for-each loop makes it easier to control the order in which elements of an array are referenced.
                                                                                                 ^
Main.java:25: error: ';' expected
A for loop generally takes a longer time to execute.
 ^
Main.java:25: error: '(' expected
A for loop generally takes a longer time to execute.
     ^
Main.java:25: error: ';' expected
A for loop generally takes a longer time to execute.
                    ^
100 errors
stdout
Standard output is empty