Clicker questions 11/14/13 CSE 1102 Fall 2013. A. Composite B. Holder C. Proxy D. Factory E. Impossible to tell from diagram In this example, we want.

Slides:



Advertisements
Similar presentations
So what's next? Introduction to data structures Two Perspectives: Abstract description (capabilities) Implementation(s) For structures: Stack Queue Deque.
Advertisements

Programming project #2 1 CS502 Spring 2006 Programming Project #2 CS-502 Operating Systems Spring 2006.
Game of Life Rules and Games Linh Tran ECE 573. What is Life? Life is just one example of a cellular automaton, which is any system in which rules are.
1 The Game of Life Supplement 2. 2 Background The Game of Life was devised by the British mathematician John Horton Conway in More sophisticated.
Week 9: Methods 1.  We have written lots of code so far  It has all been inside of the main() method  What about a big program?  The main() method.
Syntax & terminology review While the following slides are not exactly what we did on the board (object diagrams are not shown here) they cover most of.
Threads Daniel Bennett, Jeffrey Dovalovsky, Dominic Gates.
1 Lab Session-9 CSIT221 Fall 2002 Lab Exercise Based on operator overloading (Demo Required)
CS Summer 2005 Final class - July 1st Assorted fun topics in computability and complexity.
CSE 115 Week 3 January 28 – February 1, Monday Announcements Software Installation Fest: 2/5 and 2/6 4pm – 7pm in Baldy 21 Software Installation.
1 Focal Point and Images Light from a nearby object passes through a lens forming an image. Which of the following is true? a)The light is in focus at.
Conway’s Game of Life Andrew Williams
UML Class Diagram: class Rectangle
Week 3 Recap CSE 115 – Spring Constructor Special capability of a class that sets up the initial state of the object. Constructor definitions are.
Project 1CS-4513, D-Term Programming Project #1 Concurrent Game of Life Due Friday, March 20.
Fall 2005CSE 115/503 Introduction to Computer Science I1 Composition details Recall, composition involves 3 things: –Declaration of instance variable of.
SE320: Introduction to Computer Games Week 8: Game Programming Gazihan Alankus.
Programming Task: Task 1 Controlled Assessment Practice.
Variations of Conway’s Game of Life Eswar Kondapavuluri.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
1 Some Patterns of Novice Programs Author : Eugene Wallingford ; Dan Steinberg ; Robert Duvall ; Ralph Johnson Source : PLoP 2004 Advisor : Ku-Yaw Chang.
Chapter 11 Inheritance and Composition. Chapter Objectives Learn about inheritance Learn about subclasses and superclasses Explore how to override the.
Computer Science 313 – Advanced Programming Topics.
Clicker questions 11/21/13 CSE 1102 Fall neighbors, (i,j) = (2,2) [0][0] [i][j]
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Programming Concept Chapter I Introduction to Java Programming.
The Game of Life A simulation of "life". From simple rules, complex behavior arises Rules –A cell that is alive and has fewer than two live neighbors dies.
Topic 26 Two Dimensional Arrays "Computer Science is a science of abstraction -creating the right model for a problem and devising the appropriate mechanizable.
Parallel Programming 0024 Spring Semester 2010 May 6, 2010.
1 Data Structures CSCI 132, Spring 2014 Lecture 4 Implementing Life.
The Game of Life Erik Amelia Amy. What is the “Game of Life?” The “Game of Life” (often referred to as Life) is not your typical game. There are no actual.
Programming Principles Chapter 1. Objectives Discuss the program design process. Introduce the Game of Life. Discuss object oriented design. – Information.
עקרונות תכנות מונחה עצמים תרגול 6 - GUI. סיכום ביניים GUI:  Swing  Basic components  Event handling  Containers  Layouts.
Review Recursion Call Stack. Two-dimensional Arrays Visualized as a grid int[][] grays = {{0, 20, 40}, {60, 80, 100}, {120, 140, 160}, {180, 200, 220}};
CS 206 Introduction to Computer Science II 09 / 10 / 2009 Instructor: Michael Eckmann.
Homework 9 Due ( M & T sections ) ( W & Th sections ) at midnight Sun., 11/3 Mon., 11/4 Problems
Clicker questions and stuff 12/5/13 CSE 1102 Fall 2013.
Code reading skills LEVEL GAME.  Skeleton has error messages.  Notice the red lines on right slider. Click… you’ll go to an error.  pieces = levels.getPieces();
Data Types and Operations On Data Objective To understand what data types are The need to study data types To differentiate between primitive types and.
More Design Patterns Horstmann ch.10.1,10.4. Design patterns Structural design patterns –Adapter –Composite –Decorator –Proxy Behavioral design patterns.
My clicker is working. (T/F/not sure). I’m a vegetarian. (T/F/not sure)
A Variation on Conway’s Game of Life Winston Lee EPS 109.
Clicker questions 10/24/13 CSE 1102 Fall θ (x,y) (0,0) What is the relationship between θ and (x,y) ? A.y = mx + b B.θ = x 2 + y 2 C.tan(θ) = x/y;
CSE 201 – Elementary Computer Programming 1 Extra Exercises Sourceshttp://
Chapter 4 Probability and Counting Rules Section 4-2
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Clicker quiz 10/8/13 CSE 1102 Fall 2013 (E-30 reminder!)
Week 9 - Monday.  What did we talk about last time?  Method practice  Lab 8.
Random Numbers Random numbers are extremely useful: especially for games, and also for calculating experimental probabilities. Formula for generating random.
PreAP Computer Science Quiz
Week 9 - Wednesday.  What did we talk about last time?  2D arrays  Queen attacking pawn example  Started Game of Life.
Quick topix 11/7/13 CSE 1102 Fall previous statement Execute rest of program Is true? yes no This flowchart illustrates the logic of a _________.
1 Computer Programming Chapter 1: Computers and Digital Basics 1 Computer programming_BrainPop.
Quick topix 11/7/13 CSE 1102 Fall previous statement Execute rest of program Is true? yes no This flowchart illustrates the logic of a _________.
Clicker quiz 11/5/13 CSE 1102 Fall A. a FlowLayout B. a BorderLayout C. a GridGrouping D. a JSplitPane E. a GridLayout Suppose we want to to lay.
Clicker questions 10/3/13 CSE 1102 Fall public class { … private _ ; public ) { … _ = ; … } … } In the above code, what is the purpose of the parameter.
1 Welcome Alireza Humber College Lecture 1 Game 540 Alireza
Clicker quiz 10/1/13 CSE 1102 Fall public class Sun extends Ellipse { 2. public Sun(Color c) { 3. super(c); 4. … 5. } 6. public Sun() { 7. this(Color.yellow);
Question 01 Which of the following can be stored by a simple or primitive data type? (a)Only 1 single value (b)Only Attributes (c)Only Methods (d)Both.
Greenfoot.
Clicker questions 10/3/13 CSE 1102 Fall 2013.
Interface, Subclass, and Abstract Class Review
Clicker quiz 10/1/13 CSE 1102 Fall 2013.
Week 9 - Monday CS 121.
UML Class Diagram: class Rectangle
עקרנות תכנות מונחה עצמים
Interfaces and Constructors
More 2 D Array.
An Introduction to Object Orientated Programming
AP Java Learning Objectives
Presentation transcript:

Clicker questions 11/14/13 CSE 1102 Fall 2013

A. Composite B. Holder C. Proxy D. Factory E. Impossible to tell from diagram In this example, we want to be able to control the current Car using MoveButtons, an XSlider, and a YSlider. Which design pattern does this UML illustrate?

A.A Proxy has all of the methods associated with the Class it models, Holder does not B.A Holder can be associated with many classes that want to access it; a Proxy can only be accessed by 1 class C.The contents of a Holder can change, the contents of a proxy are fixed at instantiation time D.The contents of a Proxy can change, the contents of a Holder are fixed at instantiation time E.None of the above is the primary difference Both Holder and Proxy allow us to model something. The primary difference between the two is

Why does SpeedListener have a SpeedSlider _slider set in its constructor? A.The SpeedListener can work with multiple sliders. B.The code is clearer, as this is hard to sort out C.We want to distinguish between the Accelerator and the SpeedSlider D.The SpeedListener needs to refer to its enclosing SpeedSlider. E.None of the above is true 1.public class SpeedSlider extends javax.swing.JSlider{ 2. private Accelerator _accelerator; 3. public SpeedSlider(int anOrientation, Accelerator anAccelerator, 4. int aMinSpeed, int aMaxSpeed, int aCurrentSpeed){ 5. super(anOrientation, aMinSpeed, aMaxSpeed, aCurrentSpeed); 6. _accelerator = anAccelerator; this.addChangeListener(new SpeedListener(this)); 9. } 10. private class SpeedListener implements ChangeListener { 11. private SpeedSlider _slider; 12. public SpeedListener(SpeedSlider aSlider){ 13. _slider = aSlider; 14. } 15. public void stateChanged(ChangeEvent e) { 16. _accelerator.setValue(_slider.getValue()),_slider.getValue()); 17. } } }

Time public class Time { private int _hours; private int _minutes; private int _seconds; public Time(int h, int m, int s) { _hours = h; _minutes = m; _seconds = s; }

Tasks public void tick(); public int compareTo(Time otherTime); public int add (Time offset); public int subtract(Time offset);

What's up with this? A.A program that will showcase my mad Java skills B.The next CSE 1102 assignment C.A program that can compute anything that is computable D.A game that swept the world in the 1970s E.All of the above

The game Played on 2-d rectangular grid of cells A cell can be either alive or dead States (or generations) are sequential: each state is determined by rules applied to predecessor

The rules Any live cell with fewer than two live neighbors dies, as if caused by under-population. Any live cell with two or three live neighbors lives on to the next generation. Any live cell with more than three live neighbors dies, as if by overcrowding. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.

A cell can have 8 neighbors

(demo)

Model-View-Controller A structure for controlling on-screen things Model: contains the data to be displayed View: displays the data on the screen Controller: takes user input, makes changes to Model