Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jeopardy Print Me Which loop? Call Me Name Me My Mistake Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final Jeopardy.

Similar presentations


Presentation on theme: "Jeopardy Print Me Which loop? Call Me Name Me My Mistake Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final Jeopardy."— Presentation transcript:

1

2 Jeopardy Print Me Which loop? Call Me Name Me My Mistake Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final Jeopardy

3 $100 Question from Print Me "Space Oddity" (1969)

4 $100 Answer from Print Me System.out.println ("\"Space Oddity\" (1969)");

5 $200 Question from Print Me Numbers from 1 to 10

6 $200 Answer from Print Me for (int i = 1; i <= 10; i++) System.out.println(i);

7 $300 Question from Print Me Multiples of 5 from -100 to 100

8 $300 Answer from Print Me for (int i=-100; i<=100; i+=5) System.out.println(i);

9 $400 Question from Print Me Lower case letters from a-z

10 $400 Answer from Print Me for (char c=‘a’; c<=‘z’; c++) System.out.println(c);

11 $500 Question from Print Me 19 random odd numbers from 5-105

12 $500 Answer from Print Me Random r = new Random(); for (int i = 0; i < 19; i++) System.out.println( 2 * r.nextInt(26) + 5 );

13 $100 Question from Which Loop? When you don’t want to use an index value

14 $100 Answer from Which Loop? for each

15 $200 Question from Which Loop? When you are using an index value

16 $200 Answer from Which Loop? for or while

17 $300 Question from Which Loop? If you need to iterate over all elements in a collection

18 $300 Answer from Which Loop? for each (while and for valid also)

19 $400 Question from Which Loop? When processing user input

20 $400 Answer from Which Loop? while

21 $500 Question from Which Loop? When reading in data from a file

22 $500 Answer from Which Loop? while

23 $100 Question from Call Me Print something with no newline

24 $100 Answer from Call Me System.out.print(“something”);

25 $200 Question from Call Me Calculate the square root of 2

26 $200 Answer from Call Me Math.sqrt(2)

27 $300 Question from Call Me Get a line of keyboard input from the user

28 $300 Answer from Call Me Scanner s = new Scanner(System.in); s.nextLine();

29 $400 Question from Call Me credit(some amount) on a BankAccount object with a string account number and an initial balance

30 $400 Answer from Call Me BankAccount ba = new BankAccount(“12345”, 545.65); ba.credit(some_amount);

31 $500 Question from Call Me Using an isVowel(some letter) method within the current class, decrement a score if the letter is a vowel, and increment otherwise

32 $500 Answer from Call Me char c; int score = 0; if (isVowel(c)) score--; else score++;

33 $100 Question from Name Me Method where execution starts in a Java Application

34 $100 Answer from Name Me main

35 $200 Question from Name Me Creates a new instance of an object

36 $200 Answer from Name Me Constructor

37 $300 Question from Name Me Verify a method behaves as expected

38 $300 Answer from Name Me test

39 $400 Question from Name Me Data structure used to store an unknown number of Strings

40 $400 Answer from Name Me ArrayList or ArrayList

41 $500 Question from Name Me Data structure used to store 5 ints

42 $500 Answer from Name Me Array or int[] i = new int[5];

43 $100 Question from My Mistake private int x = 0

44 $100 Answer from My Mistake private int x = 0;

45 $200 Question from My Mistake public int getX() { return x;

46 $200 Answer from My Mistake public int getX() { return x; }

47 $300 Question from My Mistake if (x <= 5); x += 5;

48 $300 Answer from My Mistake if (x <= 5) x += 5;

49 $400 Question from My Mistake ArrayList strings = new ArrayList (); for (String s : strings) { System.out.println(i); }

50 $400 Answer from My Mistake ArrayList strings = new ArrayList (); for (String s : strings) { System.out.println(s); }

51 $500 Question from My Mistake for (int i = 0: i < 5: i++) { System.out.println(i); }

52 $500 Answer from My Mistake for (int i = 0; i < 5; i++) { System.out.println(i); }

53 Final Jeopardy How to implement a getMinimumPrice() method in an ITunes project

54 Final Jeopardy Answer public double getMinimumPrice() { double min = songs.get(0).getPrice(); for (Song s : songs) { if (min < s.getPrice()) min = s.getPrice(); } return min; }


Download ppt "Jeopardy Print Me Which loop? Call Me Name Me My Mistake Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final Jeopardy."

Similar presentations


Ads by Google