1 / 53

Jeopardy

Jeopardy. AP Computer Science edition Review 2. Arrays. Math. Printing / Comments. Vocabulary. Code. 100. 100. 100. 100. 100. 200. 200. 200. 200. 200. Jeopardy. 300. 300. 300. 300. 300. 400. 400. 400. 400. 400. 500. 500. 500. 500. 500. Define: Index. Arrays - 100.

anais
Télécharger la présentation

Jeopardy

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Jeopardy AP Computer Science editionReview 2

  2. Arrays Math Printing /Comments Vocabulary Code 100 100 100 100 100 200 200 200 200 200 Jeopardy 300 300 300 300 300 400 400 400 400 400 500 500 500 500 500

  3. Define: Index Arrays - 100

  4. Arrays - 200 Define: Element

  5. The way to find out how many elements are in the array Arrays - 300

  6. Write the code to copy the elements of array a into array b Arrays - 400

  7. Write code to find the middle of array a and replace it with an asterisk “*” Arrays - 500

  8. 2 * 5 + 5 / 2 Math -100

  9. 2 % 5 + 5 / 2 Math - 200

  10. Math – 300 (2 * 2 + 6) % 3

  11. Math - 400 (7 + 2) * 5 + 1

  12. Math - 500 4 + (2 + 5 * 3) % 2

  13. int average = 93;System.out.println(“My average is ” + (double) average); Printing/Comments - 100

  14. Printing/Comments - 200 System.out.println(“\tI like Apples\n A LOT!”);

  15. Printing/Comments - 300 System.out.println(“\\*This is not\n a comment *\\”);

  16. Printing/Comments - 400 System.out.println(“\\\n I am ready \n for break. \\\\ ”);

  17. Printing/Comments - 500 System.out.println(“\\\“Happy \n Birthday!*\””);

  18. Vocab - 100 Casting

  19. Vocab - 200 Modulus

  20. Vocab - 300 Concatenation

  21. Vocab - 400 SNUL

  22. Vocab - 500 Instantiation

  23. Code -100 Zero out an array

  24. Code - 200 Sum of an array

  25. Code - 300 Average of an array

  26. Code – 400 Minimum of an array

  27. Sorts an array list in reverse order Code - 500

  28. Thanks

  29. Define: Index Arrays – 100 (solution) The Index is the location of the element in the array. Other names for index are position and subscript.

  30. Define: Element Arrays – 200 (solution) The Element is the actual item stored in a position in the array.

  31. The way to find out how many elements are in the array Arrays – 300 (solution) arrayName.lengthwhere arrayName is the name of the array

  32. Write the code to copy the elements of array a into array b Arrays – 400 (solution) for(int i=0; i<a.length; i++) { b[i] = a[i];}

  33. Write code to find the middle of array a and replace it with an asterisk “*” Arrays – 500 (solution) a[a.length/2] = “*”;

  34. 2 * 5 + 5 / 2 Math - 100 (solution) 10 + 2 = 12

  35. 2 % 5 + 5 / 2 Math – 200 (solution) 2 + 2 = 4

  36. (2 * 2 + 6) % 3 Math – 300 (solution) ( 4 + 6) % 3 ( 10 ) % 3 = 1

  37. (7 + 2) * 5 + 1 Math – 400 (solution) 9 * 5 + 1 45 + 1 = 46

  38. 4 + (2 + 5 * 3) % 2 Math – 500 (solution) 4 + (2 + 15 ) % 2 4 + ( 17 ) % 2 4 + 1 = 5

  39. int average = 93;System.out.println(“My average is ” + (double) average); Printing/Comments – 100 (solution) My average is 93.0

  40. System.out.println(“\tI like Apples\n A LOT!”); Printing/Comments – 200 (solution) I like ApplesA LOT!

  41. System.out.println(“\\*This is not\n a comment *\\”); Printing/Comments – 300 (solution) \*This is not a comment *\

  42. System.out.println(“\\\n I am ready \n for break. \\\\ ”); Printing/Comments – 400 (solution) \ I am ready for break. \\

  43. System.out.println(“\\\“Happy \n Birthday!*\””); Printing/Comments – 500 (solution) \”Happy Birthday!*”

  44. Casting Vocab – 100 (solution) Casting is used to temporarily change data types:int score = (int) 83.4; yields 83double dScore = (double) 83; yields 83.0

  45. Modulus Vocab – 200 (solution) Modulus is used to get the remainder when dividing 2 numbers. In Java, % is used:int rem = 9 % 2; yields 1

  46. Concatenation Vocab – 300 (solution) Concatenation is used to combine strings together:String name = “John”;int grade = 87;String s = name + “ made a “ + grade;

  47. SNUL Vocab – 400 (solution) SNUL is an acronym which is useful when sorting strings:Spaces / special charactersNumbersUppercase charactersLowercase charactersSpaces are lower than numbers, etc.

  48. Instantiation Vocab – 500 (solution) Instantiation is used to create a new object:Student stu = new Student(“Tom”, 100);Robot karel = new Robot(1,1,West,0);

  49. Zero out an array Code – 100 (solution) for(int i =0; i<a.length; i++) { a[ i ] = 0; }

  50. Sum of an array Code – 200 (solution) int sum = 0;for(int i =0; i<a.length; i++) { sum += a[ i ]; }

More Related