SlideServe
Menu
Préférences
© SlideServe · v2026

Exam 1 Review

jerry-jefferson avatar
102 diapositives · 1.4K Views · Nov 11, 2014

Exam 1 Review. Exam 1. A lot of you found the exam to be very difficult as evidenced by some low scores. If you did not do well on the exam, please don’t panic. You will have the chance to make it up. How? We’ll get back to you on that. We are figuring out the details.

Exam 1 Review - slide 1
01 / 102Exam 1 Review
1 / 17

Télécharger la présentation

Exam 1 Review
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Exam 1 Review

  2. Exam 1 • A lot of you found the exam to be very difficult as evidenced by some low scores. • If you did not do well on the exam, please don’t panic. You will have the chance to make it up. • How? We’ll get back to you on that. We are figuring out the details. • In the meantime, learn from your mistakes! Take notes and ask questions as we review the exam. • Writing code outside of Eclipse is hard! We will work to ensure you get more practice. • Why is it important to be able to code without an IDE? • Demonstrates that you’ve grasped the concepts and don’t need a crutch to produce good code. • Coding interviews often take place on whiteboards. This is a good skill to develop early on. • I code on paper and whiteboards constantly. It’s often easier when sharing ideas with other developers. • AP exam • In-class exams

  3. Section A: Question 1 All the following are primitive data types: int, char, double, boolean, String a) TRUE b) FALSE

  4. Section A: Question 1 All the following are primitive data types: int, char, double, boolean, String a) TRUE b) FALSE

  5. Section A: Question 2 The following is an example of an implicit cast: inta = (int) (5.0 / 9.0); a) TRUE b) FALSE

  6. Section A: Question 2 The following is an example of an implicit cast: inta = (int) (5.0 / 9.0); a) TRUE b) FALSE

  7. Explicit cast vs. implicit cast An implicit cast occurs when the cast is automatically done by the compiler and no code is required. inti = 3; double d = 3; public static compute(double d) {…} compute(42); An explicit cast requires code from the programmer to inform the compiler of the cast. inti = (int)(Math.sqrt(2));

  8. Section A: Question 3 The concatenation operator is the plus sign. a) TRUE b) FALSE

  9. Section A: Question 3 The concatenation operator is the plus sign. a) TRUE b) FALSE

  10. Section A: Question 4 Adding a double and an int implicitly converts the int variable to a double and the sum is a double. a) TRUE b) FALSE

  11. Section A: Question 4 Adding a double and an int implicitly converts the int variable to a double and the sum is a double. a) TRUE b) FALSE

  12. Section A: Question 5 inta = 9; int b = 5; for (inti = 0; i <= a; i++){ b = b + i; a = a - i; } a) a = -36, b = 9 b) a = -36, b = 50 c) a = 3, b = 11 d) a = 9, b = 50 e) a = 9, b = 11

  13. Section A: Question 5 inta = 9; int b = 5; for (inti = 0; i <= a; i++){ b = b + i; a = a - i; } a = 9 b = 5 i = 0

  14. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a= 9 b= 5 i= 0

  15. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 9 b = 5 i = 0

  16. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 9 b = 5 i = 0

  17. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 9 b = 5 i = 1

  18. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 9 b = 5 i = 1

  19. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 9 b = 6 i = 1

  20. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 8 b = 6 i = 1

  21. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 8 b = 6 i = 2

  22. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 8 b = 6 i = 2

  23. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 8 b = 8 i = 2

  24. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 6 b = 8 i = 2

  25. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 6 b = 8 i = 3

  26. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 6 b = 8 i = 3

  27. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 6 b = 11 i = 3

  28. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 3 b = 11 i = 3

  29. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 3 b = 11 i = 4

  30. Section A: Question 5 inta = 9; int b = 5; for (inti= 0; i <= a; i++){ b = b + i; a = a - i; } a = 3 b = 11 i = 4

  31. Section A: Question 5 inta = 9; int b = 5; for (inti = 0; i <= a; i++){ b = b + i; a = a - i; } a) a = -36, b = 9 b) a = -36, b = 50 c) a = 3, b = 11 d) a = 9, b = 50 e) a = 9, b = 11

  32. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } a) 4 3 5 b) 4 3 5 4 c) 4 3 2 5 4 3 d) 1 3 1 2 2 3 e) 1 3 1 2 2 3 2 2

  33. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 1 j = output:

  34. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 1 j = output:

  35. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 1 j = 3 output:

  36. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 1 j = 3 output:

  37. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i= 1 j= 3 output: 4

  38. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i= 1 j= 2 output: 4

  39. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 1 j = 2 output: 4

  40. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 1 j = 2 output: 4 3

  41. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 1 j = 1 output: 4 3

  42. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 1 j = 1 output: 4 3

  43. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 2 j = output: 4 3

  44. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i= 2 j = output: 4 3

  45. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 2 j = 3 output: 4 3

  46. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 2 j = 3 output: 4 3

  47. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 2 j = 3 output: 4 3 5

  48. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 2 j= 2 output: 4 3 5

  49. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 2 j = 2 output: 4 3 5

  50. Section A: Question 6 for (inti = 1; i < 3; i++){ for (int j = 3; j > i; j--){ System.out.print(i+j + " "); } } i = 3 j = output: 4 3 5