100e Hosted by vhs © Don Link, Indian Creek School, 2004 Jeopardy.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Chapter 13 - Inheritance. Goals To learn about inheritance To learn about inheritance To understand how to inherit and override superclass methods To.
Data Types in Java Data is the information that a program has to work with. Data is of different types. The type of a piece of data tells Java what can.
CS 106 Introduction to Computer Science I 01 / 30 / 2008 Instructor: Michael Eckmann.
1 Java Object Model Part 1. 2 Type Definition: set of values – a set of values and set of operations –a set of operations that can be applied to those.
Java Syntax Primitive data types Operators Control statements.
Fundamental Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
Review CSC 171 FALL 2004 LECTURE 21. Topics Objects and Classes Fundamental Types Graphics and Applets Decisions Iteration Designing Classes Testing and.
Cmp Sci 187: Midterm Review Based on Lecture Notes.
Hello, world! Dissect HelloWorld.java Compile it Run it.
CIS Computer Programming Logic
Java Primitives The Smallest Building Blocks of the Language (corresponds with Chapter 2)
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Java Data Types. Primitive Data Types Java has 8 primitive data types: – char: used to store a single character eg. G – boolean: used to store true or.
Object-oriented Programming in Java. What is OOP?  The goal is (subtype) polymorphism  Achieved by Classes (user-defined types) Classes (user-defined.
APCS Java AB 2004 Review of CS1 and CS2 Review for AP test #1 Sources: 2003 Workshop notes from Chris Nevison (Colgate University) AP Study Guide to go.
Arrays and ArrayLists in Java L. Kedigh. Array Characteristics List of values. A list of values where every member is of the same type. Each member in.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Lec 6 Data types. Variable: Its data object that is defined and named by the programmer explicitly in a program. Data Types: It’s a class of Dos together.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 10 – Programming with Java Datatypes Type Casting.
BUILDING JAVA PROGRAMS CHAPTER 2 PRIMITIVE DATA TYPES AND OPERATIONS.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
Page: 1 การโปรแกรมเชิงวัตถุด้วยภาษา JAVA บุรินทร์ รุจจนพันธุ์.. ปรับปรุง 15 มิถุนายน 2552 Keyword & Data Type มหาวิทยาลัยเนชั่น.
Generic Programming  Object Type  Autoboxing  Bag of Objects  JCL Collections  Nodes of Objects  Iterators.
SE-1020 Dr. Mark L. Hornick 1 Inheritance and Polymorphism.
1 Programming Week 2 2 Inheritance Basic Java Language Section.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Chapter 14 Abstract Classes and Interfaces. Abstract Classes An abstract class extracts common features and functionality of a family of objects An abstract.
Chapter 5 Objects and Classes Inheritance. Solution Assignments 3 & 4 Review in class…..
Java Programming, Second Edition Chapter Two Using Data Within a Program.
Final Jeopardy Fundamen tal Java Numerical Data type Boolean Expressi on If/THEN/ WHILE Miscellan eous
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Chapter 7: Class Inheritance F Superclasses and Subclasses F Keywords: super and this F Overriding methods F The Object Class F Modifiers: protected, final.
COM S 207 Literal, Operator, and Expression Instructor: Ying Cai Department of Computer Science Iowa State University
Java Nuts and Bolts Variables and Data Types Operators Expressions Control Flow Statements Arrays and Strings.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
(c) University of Washington06-1 CSC 143 Java Inheritance Tidbits.
Chapter 5 Defining Classes II Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
11 PART 2 ARRAYS. 22 PROCESSING ARRAY ELEMENTS Reassigning Array Reference Variables The third statement in the segment below copies the address stored.
CS Prelim Review – 10/15/09  First prelim is TOMORROW at 7:30 PM  Review session – Tonight 7:30 PM, Phillips 101  Things you should do:  Review every.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
Java Generics. Lecture Objectives To understand the objective of generic programming To be able to implement generic classes and methods To know the limitations.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 10 Java Fundamentals Objects/ClassesMethods.
CompSci 100E JB1.1 Java Basics (ala Goodrich & Tamassia)  Everything is in a class  A minimal program: public class Hello { public static void main(String[]
Java: Base Types All information has a type or class designation
Object-oriented Programming in Java
Java: Base Types All information has a type or class designation
Java Primer 1: Types, Classes and Operators
Mid Term Review Advanced Programming Ananda Gunawardena
Fundamental of Java Programming Basics of Java Programming
Java Programming: From Problem Analysis to Program Design, 4e
Methods and Parameters
Recitation 6 Inheritance.
Overloading and Constructors
Object Oriented Programming (OOP) LAB # 8
Unit-2 Objects and Classes
CSC 113: Computer programming II
An Introduction to Java – Part I, language basics
Week 6 Object-Oriented Programming (2): Polymorphism
Building Java Programs
Java Programming Review 1
Fundamental OOP Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
Java Programming Language
In this class, we will cover:
Peer Instruction 4 Control Loops.
Overloading Each method has a signature: its name together with the number and types of its parameters Methods Signatures String toString()
Problem 1 Given n, calculate 2n
Presentation transcript:

100e Hosted by vhs © Don Link, Indian Creek School, 2004 Jeopardy

$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

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

What is wrong with the following code that converts Celcius to Farenheit? Casting error. Always == 0 Code for $400

These are the values of m and n after the following code executes. m == n == 0 Code for $600

This is the output of the following code. The program doesn’t print anything. (Why?) Code for $800

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

This is the definition of a recursive function. Function that calls itself Recursion for $200

All recursive functions have these 2 parts. Base case and recursion w/ changing measure Recursion for $400

This is the fatal flaw in the call badRecurse(5); Doesn’t converge on base case => infinite recursion Recursion for $600

This is the output of mystery(2,3) Returns 5. More generally, the sum of a and b. Recursion for $800

This is the output of the call printMe(“”, “two”); Anagrams Recursion for $1000

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

All classes in Java inherit from this superclass Object Objects for $400

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

These are the two other functions Soup needs to override be considered an example of “good” subclass. hashCode() & equals() Objects for $800

Implement a robust equals() for Soup Answer Objects for $1000

An alternate way of referring to this data structure is a “LIFO” array. Stack Data Structures for $200

This is the output of the code below: Hello I am Data Structures for $400

This is the problem with the code below: Adding objects of wrong type to ArrayList Data Structures for $600

??? Should be replaced with this to make this 2D array function properly. data[row].length Data Structures for $800

Given an array int[] a, calculate the sum of the odd numbers in the array. Answer Data Structures for $1000

These are 4 of the 8 true primitive data types in Java Short, long, double, float, int, byte, char, boolean Potpourri for $200

This is a java literal that means “no object” null Potpourri for $400

Arithmetic operators (like +, -, *, /) have _____ precedence than logical operators (like ||, &&, !) so arithmetic is done _____. Higher, first Potpourri for $600

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

This is the output of the code snippet below: 1,2,3,4,5,6,7,8,9,10 Potpourri for $1000