CSE 113 Week 3 January 28 – February 1, 2008. Monday Announcements  Software Installation Fest: 2/5 and 2/6 4pm – 7pm in Baldy 21 Bring your laptop or.

Slides:



Advertisements
Similar presentations
The Line Class Suppose you are involved in the development of a large mathematical application, and this application needs an object to represent a Line.
Advertisements

Time Series Analysis – Homework Homework Rules: All homework must be completed by due date Homework may be done in groups – please put names of all group.
1 karel_part4_functions.ppt Functions Functions return values or Objects. –Using a function allows the programmer to focus on other task. –Using a function.
Lecture 2 Calling and Defining Methods in Java. Introduction ●Calling and defining methods ●Declaring and defining a class ●Instances of a class ●The.
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.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
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.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
CSE 115 Week 5 February , Monday Announcements Exam 3 today Exam 3 today Lab 3 due this week Lab 3 due this week Exam 4 Monday 2/18 Exam.
Week 4 Recap CSE 115 Spring Formal Parameter Lists Comma-separated list of formal parameters Formal parameters are listed giving the type of the.
© The McGraw-Hill Companies, 2006 Chapter 5 Arrays.
Java Syntax, Java Conventions, CSE 115 Conventions (Part 2) CSE 115 Spring 2006 January 30, February 1 & 3, 2006.
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.
CSE 115 Week 6 February , Announcements Software Installation Fest – Take 2 Software Installation Fest – Take 2 –Tuesday 2/ –Wednesday.
CSE 115 Week 4 February 4 - 8, Monday Announcements Software installation fest Tuesday & Wednesday 4-7 in Baldy 21. Software installation fest Tuesday.
CSE 113 Week 5 February , Announcements  Module 2 due 2/15  Exam 3 is on 2/15  Module 3 due 2/22  Exam 4 is on 2/25  Module 4 due 2/29.
CSE 250: Data Structures Week 3 January 28 – February 1, 2008.
Week 3 Recap CSE 115 – Fall Java Source Code File Made up of: Package declaration Class definition.
CSE 115 Week 2 January , Wednesday Announcements Pick up Syllabus if you need one Pick up Syllabus if you need one Recitation Change Form.
Games and Simulations O-O Programming in Java The Walker School
3.1 Documentation & Java Language Elements Purpose of documentation Assist the programmer with developing the program Assist other programers who.
Object Oriented Software Development
Classes Java is an Object-Orented Programming language, and one of the main advantages of OOP is code reuse. Code reuse: write code only once, put it in.
CSE 113 Introduction to Computer Programming Lecture slides for Week 4 Monday, September 19 th, 2011 Instructor: Scott Settembre.
Karel J Robot An introduction to BlueJ and Object- Oriented Programming.
CompSci 42.1Intro to Java Anatomy of a Class & Terminology Running and Modifying a Program.
CSE115 / CSE503 Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall 1.
Creative Commons Attribution Non-Commercial Share Alike License sa/3.0/
Working with Word Problems IM1. Objectives Students will be able to:  translate word problems into equations with a single variable.  solve equations.
Methods in Java CSC1401. Overview In this session, we are going to see how to create class-level methods in Java.
CS 101: Introduction to computer programming and utilization Abhiram Ranade.
Copyright © Curt Hill Turtles The beginning of media computation.
5 BASIC CONCEPTS OF ANY PROGRAMMING LANGUAGE Let’s get started …
BIT 115: Introduction To Programming LECTURE 3 Instructor: Craig Duckett
Methods in Java. Program Modules in Java  Java programs are written by combining new methods and classes with predefined methods in the Java Application.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
Greenfoot Game Programming Club.
Anatomy.1 Anatomy of a Class & Terminology. Anatomy.2 The Plan Go over MoveTest.java from Big Java Basic coding conventions Review with GreeterTest.java.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall
Comp 248 Introduction to Programming Chapter 4 & 5 Defining Classes Part B Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia.
1 CS161 Introduction to Computer Science Topic #9.
CreatingSubclasses1 Barb Ericson Georgia Institute of Technology Dec 2009.
CIS125G Computer Game Development. Goals Learn: – How to design games – How games are studied – How games are developed – How to manage software projects.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 11 – How to Get Started on Assignment #2 Webpage:
Lecture 71 CS110 Lecture 8 February 19, 2004 Announcements –hw3 due tonight –hw4 available, due Thursday February 26 –exam Tuesday March 2 Agenda –questions.
1 Printing in Python Every program needs to do some output This is usually to the screen (shell window) Later we’ll see graphics windows and external files.
CHAPTER 14 Classes, Objects, and Games XNA Game Studio 4.0.
Week 8 - Friday.  What did we talk about last time?  Static methods.
1 Predefined Classes and Objects Chapter 3. 2 Objectives You will be able to:  Use predefined classes available in the Java System Library in your own.
CS 5JA Introduction to Java Graphics One of the powerful things about Java is that there is.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Object Orientated Programming in Perl Simulated Models of Termites.
CompSci 42.1Intro to Java Anatomy of a Class & Terminology Running and Modifying a Program.
CS180 Recitation Chapter 7: Defining Your Own Classes II.
Winter 2016CISC101 - Prof. McLeod1 CISC101 Reminders Quiz 3 next week. See next slide. Both versions of assignment 3 are posted. Due today.
What is an object?. What Makes an Object? An object has identity (it acts as a single whole). Every object has a name that identifies what it is. Ex.
BIT 115: Introduction To Programming Professor: Dr. Baba Kofi Weusijana Pronounced Bah-bah Co-fee Way-ou-see-jah-nah Call him “Baba” or “Dr. Weusijana”
Hackety Hack! Written by Krystal Salerno Presented by _______________.
More methods, more capabilities
CSE 115 September 29 – October 3, 2008.
CISC101 Reminders Assn 3 due tomorrow, 7pm.
CSE 115 September 29 – October 3, 2008.
Which best describes the relationship between classes and objects?
Creative Commons Attribution Non-Commercial Share Alike License
February , 2009 CSE 113 B.
February 2 - 6, 2009 CSE 113 B.
Unit-2 Objects and Classes
CISC101 Reminders Assignment 3 due today.
The beginning of media computation Followed by a demo
Presentation transcript:

CSE 113 Week 3 January 28 – February 1, 2008

Monday Announcements  Software Installation Fest: 2/5 and 2/6 4pm – 7pm in Baldy 21 Bring your laptop or desktop to have appropriate software installed!  Module 1 due 2/8  Module 2 due 2/15

Monday Game Plan  Exam 1  More work with objects

Monday  We can create a world  We can create a turtle and put it in the world  If we assign the turtles to a variable, then we can ask them to do things

Monday  Things turtles can do: moveTo(int, int) turnRight() turnLeft() forward() forward(int) turn(int) penUp() penDown()

Wednesday Announcements  Software Installation Fest: 2/5 and 2/6 4pm – 7pm in Baldy 21 Bring your laptop or desktop to have appropriate software installed!  Exam 2 on 2/6  Module 1 due 2/8  Module 2 due 2/15

Wednesday Game Plan  Vocabulary and terminology

Wednesday  It is important to know the proper terms for the things we are studying, so we should make sure we clarify the names of the programmatic elements you have been working with so far this semester.

Wednesday  new Turtle()  new is a keyword in Java. Keywords are special to the language and can only be used for a specific purpose. Java knows these purposes, so every time it sees that keyword it performs the exact same operations each time.  When it sees new, it knows we are about to create a new instance of something.

Wednesday  new Turtle()  Turtle is the name of the class we are creating an instance of, but in the context of this entire statement, Turtle is the name of a constructor that we are trying to invomke. Constructors for classes have the same name as the class itself.

Wednesday  new Turtle()  The () are called a parameter list. Parameter lists provide additional information to a constructor when we are calling it. Note that sometimes our parameter lists have been empty and other times we have needed to put information inside them.

Wednesday  new Turtle()  This whole line is used when we are creating an object.  We can create an object and assign it to a variable by using this code: Turtle t = new Turtle();

Wednesday  After we have a variable that refers to our object, we can call methods on it to ask the object to perform actions for us.  The syntax for a method call is: object.methodName();

Wednesday  object.methodName();  object is the name of the object (the name of the variable referring to the object) that we would like to invoke the method upon.  methodName is the name of the method we are trying to invoke  () is another parameter list, can be empty or have information.

Wednesday  In order for the object to be able to react to the method call, the method must have been pre-defined inside the code.  Note that some methods that have the same name (like forward in the Turtle) can exist together. The reason for this is because they take different parameters.

Wednesday  The grid the turtles live on is like the coordinate plan you may have studied in math class, but it has some key differences you should know about. The origin (0,0) is in the upper left hand corner. X-values increase going right Y-values increase as you go down

Friday Announcements  Software Installation Fest: 2/5 and 2/6 4pm – 7pm in Baldy 21 Bring your laptop or desktop to have appropriate software installed!  Exam 2 on 2/6  Module 1 due 2/8  Module 2 due 2/15

Friday Game Plan  Working with Media (not Turtles)  What happens when you reassign variables that are referring to Turtles?

Friday  There is a picture object that you can create.  It needs to know what the name of the file is that should be displayed.  You can get this by using the FileChooser.pickAFile() method.  There is a Sound object that can be created as well.

Friday  Variables that refer to Turtles and to other objects as well are slightly different than those that referred to numbers.  If you have two turtles t1 & t2 defined and you say:  t1 = t2;  Both t1 & t2 refer to the same turtle and the turtle that is referred to by t1 is no longer accessible in the program.