Download presentation
Presentation is loading. Please wait.
Published byBartholomew Scott Modified over 9 years ago
2
100e Hosted by vhs © Don Link, Indian Creek School, 2004 Jeopardy
3
$200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 Code Recursion Objects Data Structures Potpourri
4
What are the values of: (((14 >= 0) || (4 != 3)) && (22 % 7 == 1) and 7 * 8 % 10 / (-2 * -2.0) True and 1.5 Code for $200
5
What is wrong with the following code that converts Celcius to Farenheit? Casting error. Always == 0 Code for $400
6
These are the values of m and n after the following code executes. m == 987654321 n == 0 Code for $600
7
This is the output of the following code. The program doesn’t print anything. (Why?) Code for $800
8
Write the following function: Start with 2 int arrays (a and b). Return the array which has the largest sum. In the event of a tie, return a. Answer Code for $1000
9
This is the definition of a recursive function. Function that calls itself Recursion for $200
10
All recursive functions have these 2 parts. Base case and recursion w/ changing measure Recursion for $400
11
This is the fatal flaw in the call badRecurse(5); Doesn’t converge on base case => infinite recursion Recursion for $600
12
This is the output of mystery(2,3) Returns 5. More generally, the sum of a and b. Recursion for $800
13
This is the output of the call printMe(“”, “two”); Anagrams Recursion for $1000
14
In the class Soup, identify the: a) instance variables b) constructor c) methods. myPeas, myCarrots, myBrand, myCalories Soup(int peas, int carrots, String brand) getPeas(), getCarrots(), getCalories(), toString(), calories() Objects for $200
15
All classes in Java inherit from this superclass Object Objects for $400
16
When working with an object, the keyword “this” performs this function. Way to reference the object whose name was used to invoke the method. Objects for $600
17
These are the two other functions Soup needs to override be considered an example of “good” subclass. hashCode() & equals() Objects for $800
18
Implement a robust equals() for Soup Answer Objects for $1000
19
An alternate way of referring to this data structure is a “LIFO” array. Stack Data Structures for $200
20
This is the output of the code below: Hello I am Data Structures for $400
21
This is the problem with the code below: Adding objects of wrong type to ArrayList Data Structures for $600
22
??? Should be replaced with this to make this 2D array function properly. data[row].length Data Structures for $800
23
Given an array int[] a, calculate the sum of the odd numbers in the array. Answer Data Structures for $1000
24
These are 4 of the 8 true primitive data types in Java Short, long, double, float, int, byte, char, boolean Potpourri for $200
25
This is a java literal that means “no object” null Potpourri for $400
26
Arithmetic operators (like +, -, *, /) have _____ precedence than logical operators (like ||, &&, !) so arithmetic is done _____. Higher, first Potpourri for $600
27
Rewrite the following code using a for loop. for (int count =7; count >= 4; count--) { System.out.println(count + “ “); System.out.println(count + “ “);} Potpourri for $800
28
This is the output of the code snippet below: 1,2,3,4,5,6,7,8,9,10 Potpourri for $1000
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.