You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _sources/TimedTests/Exercises.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -275,7 +275,7 @@ Click the |start| button when you are ready to begin the exam, but only then as
275
275
:correct: d
276
276
:feedback_a: This would be true if it was return(a[1]*= 2);.
277
277
:feedback_b: This would be true if the return statement was return (a[0]*=2);.
278
-
:feedback_c: This would be true if it was a[0]--; Or it would be true if array indicies started at 1, but they start with 0.
278
+
:feedback_c: This would be true if it was a[0]--; Or it would be true if array indices started at 1, but they start with 0.
279
279
:feedback_d: The statement a[1]--; is the same as a[1] = a[1] - 1; so this will change the 3 to a 2. The return (a[1] * 2) does not change the value at a[1].
280
280
:feedback_e: This can't be true because a[1]--; means the same as a[1] = a[1] - 1; So the 3 will become a 2. Parameters are all pass by value in Java which means that a copy of the value is passed to a method. But, since an array is an object a copy of the value is a copy of the reference to the object. So changes to objects in methods are permanent.
Copy file name to clipboardExpand all lines: _sources/TimedTests/test1.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -546,7 +546,7 @@ Click the |start| button when you are ready to begin the exam, but only then as
546
546
:correct: d
547
547
:feedback_a: This would be true if it was <code>return(a[1]*= 2);</code>.
548
548
:feedback_b: This would be true if the return statement was <code>return (a[0]*=2);</code>.
549
-
:feedback_c: This would be true if it was <code>a[0]--;</code> Or it would be true if array indicies started at 1, but they start with 0.
549
+
:feedback_c: This would be true if it was <code>a[0]--;</code> Or it would be true if array indices started at 1, but they start with 0.
550
550
:feedback_d: The statement <code>a[1]--;</code> is the same as <code>a[1] = a[1] - 1;</code> so this will change the 3 to a 2. The return <code>(a[1] * 2)</code> does not change the value at <code>a[1]</code>.
551
551
:feedback_e: This can't be true because <code>a[1]--;</code> means the same as <code>a[1] = a[1] - 1;</code> So the 3 will become a 2. Parameters are all pass by value in Java which means that a copy of the value is passed to a method. But, since an array is an object a copy of the value is a copy of the reference to the object. So changes to objects in methods are permanent.
Copy file name to clipboardExpand all lines: _sources/Unit6-Arrays/Exercises.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -356,7 +356,7 @@ You can step through the code above with the Java Visualizer by clicking the fol
356
356
:correct: b
357
357
:feedback_a: This would be true if it was <code>return (a[1] *= 2);</code>, which would change the value at <code>a[1]</code>.
358
358
:feedback_b: The statement <code>a[1]--;</code> is the same as <code>a[1] = a[1] - 1;</code> so this will change the 3 to 2. The <code>return (a[1] * 2)</code> does not change the value at <code>a[1]</code>.
359
-
:feedback_c: This would be true if array indicies started at 1 instead of 0 and if the code changed the value at index 1 to the current value times two.
359
+
:feedback_c: This would be true if array indices started at 1 instead of 0 and if the code changed the value at index 1 to the current value times two.
360
360
:feedback_d: This would be true if array indices started at 1 rather than 0.
361
361
:feedback_e: This can't be true because <code>a[1]--;</code> means the same as <code>a[1] = a[1] - 1;</code> so the 3 changes to 2. Parameters are all pass by value in Java which means that a copy of the value is passed to a method. But, since an array is an object a copy of the value is a copy of the reference to the object. So changes to objects in methods are permanent.
Copy file name to clipboardExpand all lines: _sources/Unit6-Arrays/arrayExam.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Click the "Start" button when you are ready to begin the exam, but only then as
51
51
:feedback_a: This would be true if the while loop continued as long as i1 and i2 where greater than or equal to 0.
52
52
:feedback_b: This loops and only increments count when the same value is in x1 and x2, but it doesn't compare the values at index 0 since it stops when either index is 0.
53
53
:feedback_c: It may appear that the indices get out of synchronization, but check out the else if and else code.
54
-
:feedback_d: The very first time through the loop the values at the two indicies are equal and count is incremented.
54
+
:feedback_d: The very first time through the loop the values at the two indices are equal and count is incremented.
55
55
56
56
What is the value of ``count`` after the following code has executed?
57
57
@@ -124,7 +124,7 @@ Click the "Start" button when you are ready to begin the exam, but only then as
124
124
:correct: e
125
125
:feedback_a: While count starts at 0 it is incremented when a match is found, which will happen when i1 is 1 and i2 is 0.
126
126
:feedback_b: This would be true if the loop stopped after the first match was found, but it does not.
127
-
:feedback_c: This would be true if the code only looked for a match at the same indicies.
127
+
:feedback_c: This would be true if the code only looked for a match at the same indices.
128
128
:feedback_d: This would be true if both i2 and i1 were incremented when a match was found.
129
129
:feedback_e: This code only increments i2 when a match is found, which means that the 2 at position 2 in x1 matches both 2's in x2.
Copy file name to clipboardExpand all lines: _sources/Unit8-2DArray/a2dEasyMC.rst
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,9 @@ You can see how the array looks by clicking on the following `Ex-9-7-1 <http://c
31
31
:answer_e: <code>strGrid[0][0] = "S";</code>
32
32
:correct: d
33
33
:feedback_a: The code <code>letterGrid[0][2] = "S";</code> actually sets the 1st row and 3rd column to hold a reference to the <code>String</code> object "S".
34
-
:feedback_b: This would be true if row and column indicies started at 1 instead of 0 and if this was in column major order.
35
-
:feedback_c: This would be true if row and column indicies started at 1 instead of 0.
36
-
:feedback_d: In row-major order the row is specified first followed by the column. Row and column indicies start with 0. So <code>letterGrid[2][0]</code> is the 3rd row and 1st column.
34
+
:feedback_b: This would be true if row and column indices started at 1 instead of 0 and if this was in column major order.
35
+
:feedback_c: This would be true if row and column indices started at 1 instead of 0.
36
+
:feedback_d: In row-major order the row is specified first followed by the column. Row and column indices start with 0. So <code>letterGrid[2][0]</code> is the 3rd row and 1st column.
37
37
:feedback_e: This would set the element at the first row and column.
38
38
39
39
Which of the following statements assigns the letter S to the third row and first column of a two-dimensional array named ``strGrid`` (assuming row-major order).
@@ -47,10 +47,10 @@ You can see how the array looks by clicking on the following `Ex-9-7-1 <http://c
47
47
:answer_e: a[3][1]
48
48
:correct: c
49
49
:feedback_a: This would be true if the row index started at 0, but the column index started at 1.
50
-
:feedback_b: Both the row and column indicies start with 0.
50
+
:feedback_b: Both the row and column indices start with 0.
51
51
:feedback_c: The value 6 is at row 0 and column 2.
52
52
:feedback_d: The row index is specified first, then the column index.
53
-
:feedback_e: The row index is specified first and the indicies start at 0.
53
+
:feedback_e: The row index is specified first and the indices start at 0.
54
54
55
55
How would you get the value 6 out of the following array ``int[][] a = { {2, 4, 6, 8}, {1, 2, 3, 4}};``?
Copy file name to clipboardExpand all lines: _sources/Unit8-2DArray/topic-8-1-2D-arrays-Day2.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ Try the code below. Did it print what you expected? When you print a two dimens
131
131
:feedback_a: Remember that the indices start at 0.
132
132
:feedback_b: Remember that the row is first then the column.
133
133
:feedback_c: This will set the value of the 3rd row and 2nd column.
134
-
:feedback_d: Remember that the row is first and then the column and that the indicies start at 0.
134
+
:feedback_d: Remember that the row is first and then the column and that the indices start at 0.
135
135
136
136
Which of the following sets the value for the 3rd row and 2nd column of a 2D array called ``nums``?
137
137
@@ -162,7 +162,7 @@ Get a Value from a 2D Array
162
162
.. index::
163
163
pair: 2D Array; access value
164
164
165
-
To get the value in a 2D array give the name of the array followed by the row and column indicies in square brackets. The code below will get the value at row index 1 and column index 0 from ``ticketInfo``. It will also get the value at row index 0 and column index 1 from ``seatingChart``.
165
+
To get the value in a 2D array give the name of the array followed by the row and column indices in square brackets. The code below will get the value at row index 1 and column index 0 from ``ticketInfo``. It will also get the value at row index 0 and column index 1 from ``seatingChart``.
Copy file name to clipboardExpand all lines: _sources/Unit8-2DArray/topic-8-2-2D-array-loops-Day1.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Arrays know their length (how many elements they can store). The length is a pu
52
52
:answer_d: nums[1][2]
53
53
:correct: c
54
54
:feedback_a: This would be true if array indices started with 1 but they start with 0.
55
-
:feedback_b: This would be true if array indicies started with 1 and the column was specified first. However, array indices start at 0 and the row is given first in row-major order.
55
+
:feedback_b: This would be true if array indices started with 1 and the column was specified first. However, array indices start at 0 and the row is given first in row-major order.
56
56
:feedback_c: Array indices start with 0 so the third row has an index of 2 and the second column has an index of 1.
57
57
:feedback_d: This would be true if the column index was first, but in row-major order the row index is first.
0 commit comments