DavidL0914 / DavidCSA2025

Apache License 2.0
0 stars 0 forks source link

Collegeboard MCQ #8

Open DavidL0914 opened 1 week ago

DavidL0914 commented 1 week ago

Reviewing 2014 CB Practice Exam

DavidL0914 commented 1 week ago

Score: 32/40 - Cross review with Joshua Thinh Missed question: 1.Misread question

  1. Integer Division in Java Results in Truncation: When dividing two integers in Java, the result is truncated, meaning only the whole number portion of the quotient is retained, and any fractional part is discarded. For example, 5 / 3 yields 1 because the remainder is ignored. To get a more accurate result, you can use typecasting to convert one or both integers to a double: double result = (double) 5 / 3; // Result: 1.666...

  2. Misread question

  3. Enhanced for Loop in 2D Arrays: When using an enhanced for loop with a 2D array, the loop variable iterates over the elements of the array rather than indices. For example, in for (int[] row : array), row will refer to each sub-array of the 2D array, not a specific row index. Similarly, in for (int val : row), val represents each element of that sub-array. Be mindful that you cannot directly access specific indices using enhanced loops without maintaining additional variables.

  4. .substring(x, y): The .substring(x, y) method in Java extracts a substring from index x (inclusive) to index y (exclusive). For example, "hello".substring(0, 2) results in "he". If x == y, the result is an empty string. Always ensure x and y are valid indices to avoid runtime errors.

  5. n is not initialized to 0, so we need answer.

  6. Keep track of infinite loops. k is never changed in the body of the while loop, it will always be 1 and less than 4, so it causes an infinite loop. For example: int k = 1;
    while (k < 4) {
    System.out.println("Infinite loop!");
    // k is never updated, so the condition k < 4 is always true }

  7. Be careful of work

DavidL0914 commented 1 week ago

{9D1E5A5B-826C-4FB3-B0CF-03948D7AFD31}

DavidL0914 commented 1 week ago

4. {BEB2EEAF-E72D-4A6A-88E1-E7599CEEF90C} C. Value is: 2

21. {E6EC2703-BC36-4522-ADF5-D2C3910C6A36} D. Math.abs (num - val) < minDiff

23. {290EA4B5-400D-4750-B0FC-8B4DE92F1FDA} B. ["bear", "zebra", "bass", "cat", "koala", "baboon"]

33. {26E1A060-A250-42E8-9998-1F97BADD4DB3} C. 12

39. {736D5264-D373-42D3-A94D-53FCAA9FFB65} D. 16

DavidL0914 commented 1 week ago

{F3F2E986-A2E8-4405-B716-5FA7F34689F4} Practice more to be able to finish faster!!

I was spending extra time though to go over work and collaborate with peers, but still should go faster while maintaining accuracy.

JoshThinh commented 1 week ago

Had a deep understanding of all the questions that he got wrong with long explanations of why it was correct. Something he could have done next time is read the questions slower to truly understand the questions.