Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/http://creativecommons.org/licenses/by-nc-

Slides:



Advertisements
Similar presentations
Picture It Very Basic Game Picture Pepper. Original Game import java.util.Scanner; public class Game { public static void main() { Scanner scan=new Scanner(System.in);
Advertisements

Week 8 - Monday.  What did we talk about last time?  StdAudio.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Lecture 6. What is the difference in pictures ???
Writing methods. Calling Methods nameOfMethod(parameters) if method returns something, use that value Math.pow(2, 3) returns 8 System.out.println(Math.pow(2,
Building Java Programs
TOPIC 9 MODIFYING PIXELS IN A MATRIX: COPYING, CROPPING 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
CSE 8A Lecture 8 Reading for next class: None Prepare for In-term exam 2 PSA4: Collage and Picture Flip, DON’T WAIT (it’s longer than the previous PSAs)
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Introduction to Programming Writing Java Beginning Java Programs.
11 A First Game Program Session Session Overview  Begin the creation of an arcade game  Learn software design techniques that apply to any form.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CSE8A Lecture3 TODO: –Finish PSA1 individually (no partner!) and turn it in with the bundlePSA1 command GET AN INTERVIEW for PSA1 from a tutor See tutor.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Problem of the Day  Why are manhole covers round?
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Copyright 2008 by Pearson Education 1 Building Java Programs Chapter 2 Lecture 2-3: Loop Figures and Constants reading: self-checks: 27 exercises:
Case study Students. Array of objects Arrays can hold objects (ref to objects!) Each cell in an array of objects is null by default Sample: from student.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CSE 8A Lecture 8 Reading for next class: PSA4: Collage and Picture Flip, DON’T WAIT (it’s longer than the previous PSAs)
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CSC1401 Classes - 2. Learning Goals Computing concepts Adding a method To show the pictures in the slide show Creating accessors and modifiers That protect.
Introduction to Programming Writing Java Beginning Java Programs.
NestedLoops-Mody7-part51 Two-Dimensional Arrays and Nested Loops – part 5 Rotations Barb Ericson Georgia Institute of Technology May 2007.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Copyright 2010 by Pearson Education 1 Building Java Programs Chapter 2 Lecture 4: Loop Figures and Constants reading:
More Array Access Examples Here is an example showing array access logic: const int MAXSTUDENTS = 100; int Test[MAXSTUDENTS]; int numStudents = 0;... //
1 Building Your Own Turtle Functions For making really cool pictures!
1 BUILDING JAVA PROGRAMS CHAPTER 2 PRIMITIVE DATA AND DEFINITE LOOPS.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Week 8 - Friday.  What did we talk about last time?  Static methods.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
CSE8A Lecture 5 TODO: –FINISH PSA2 WITH YOUR PARTNER! Read next class: Section 5.1. PLAY WITH CODE! –Get stuck, then figure out how to get unstuck – it’s.
COP 2220 Computer Science I Topics –Breaking Problems Down –Functions –User-defined Functions –Calling Functions –Variable Scope Lecture 4.
Copyright 2008 by Pearson Education 1 Nested loops reading: 2.3 self-check: exercises: videos: Ch. 2 #4.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Problem of the Day  Why are manhole covers round?
10/16/07.
Topic 9 Modifying Pixels in a Matrix: Copying, Cropping
CSE 8A Lecture 17 Reading for next class: None (interm exam 4)
Creative Commons Attribution Non-Commercial Share Alike License
Building Java Programs
Week 8 - Friday CS 121.
Week 8 - Monday CS 121.
CSE 143 Lecture 9 References and Linked Nodes reading: 3.3; 16.1
Do further research on the internet
CSE 8A Lecture 6 Reading for next class:
Building Java Programs
Chap. 3 Functions Start Python IDLE (Shell) and open a new file.
Building Java Programs
Creative Commons Attribution Non-Commercial Share Alike License
class PrintOnetoTen { public static void main(String args[]) {
Building Java Programs
Week 4 Lecture-2 Chapter 6 (Methods).
Creative Commons Attribution Non-Commercial Share Alike License
Creative Commons Attribution Non-Commercial Share Alike License
Building Java Programs
Suggested self-checks: Section 7.11 #1-11
Building Java Programs
Building Java Programs
Building Java Programs
CS100A Sections Dec Loop Invariant Review C Review and Example
Building Java Programs
Chapter 2 Lecture 2-3: Loop Figures and Constants reading:
Presentation transcript:

Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/ sa/3.0/ Original Developer: Beth Simon, 2009

CSE8A Lecture 13 Read next class: read pg PSA4: Read the specification CAREFULLY –Draw out what you think PictureFlip should do FIRST –Understand the main program that “driver” the PictureFlip method – talk about how it works with others, tutors Discussion Section NOW in Center 214 Grade distributions are posted on moodle. –See how your score fits in with what others are getting –This class is NOT graded on a curve, it is based on meeting baseline mastery But you can still figure out if you “need to do something differently” from others

How do you think you are doing in this class? A.I think I’m on top of it! B.I think I’m getting most everything. C.I think I’m getting barely enough to keep up, but I’m pretty sure I’ll get it eventually D.I think I’m not understanding as much as I need to. E.I think I am really lost and I understand little of what is going on now.

Upcoming Events  Cisco Fest  Tues., 10/27, 5-7pm, CSE 1202  Blizzard Jacobs  Wed., 10/28, & 12-1pm, CSE 1202  Salesforce.com Jacobs  Wed., 10/28, 5:30-7pm, CSE 1202  Yahoo! Jacobs  Thurs., 10/29, 3:30-4:30pm, CSE 1202 Information Sessions Free Food Prizes & Giveaways Internships Career Opportunities And More! Corporate Affiliates Program

By the end of today’s class you should be able to… LG25: Read, trace, and write code that performs a transformation over a restricted set of pixels (like a “box” of pixels). LG26: Read, trace and write a method that uses more than one Picture object (including where one Picture is the calling object). LG27: Modify a method to make it more “flexible” by replacing constants with parameters. LG29: Compare and contrast code which modifies pictures conditionally based on pixel index location, based on Color of the pixel or both. LG30: Write and read code that either loops over a subset of pixels, or loops over all pixels and controls changes to pixels with an if statement

Parameters: Better than constants Generally want code that will be “user controllable” –Like video games – hit “A” – shoot/jump Though the “hard codes” constants ( ) a lot, we want to use VARIABLES controlled by PARAMETERS –This lets us re-use code like “cropping and pasting into a blank canvas” no matter what part of the source picture we want to crop and no matter where we want to PLACE it in the canvas.

public static void main(String[] args) { World w = new World(100,200); Turtle jose = new Turtle(10,20,w); int turnDegrees = 90; jose.turn(turnDegrees); } public class Turtle { public void turn(int foo) { for (int i = 0; i< foo; i++) { //Code to make the turtle turn one degree right }

Underline the values you would change into parameters and write a new method header public void copyKatiesXXX( ) { Pixel sPixel, tPixel = null; for (int sX = 40, tX = 100; sX < 110; sX++, tX++) { for (int sY = 350, tY = 100; sY < 400; sy++, tY++) { sPixel = sourcePic.getPixel(sX,sY); tPixel = this.getPixel(tX,tY); tPixel.setColor(sPixel.getColor(); }