CSE 113 Introduction to Computer Programming Lecture slides for Week 3 Monday, September 12 th, 2011 Instructor: Scott Settembre.

Slides:



Advertisements
Similar presentations
Take a tour of De Gruyter Online
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Jump to Contents Instructor Tutorial essignments.com Paperless assignment submission system.
1. XP 2 * The Web is a collection of files that reside on computers, called Web servers. * Web servers are connected to each other through the Internet.
IQuote User Guide (1.2) Use your portal username and password
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 5 Author: Julia Richards and R. Scott Hawley.
Wikispaces 101 Training Standards & Interoperability (S&I) Framework May 30, :00 - 5:00pm EDT 1.
HERMES TUTORIAL version 1.0 Published 24th July 2007 This tutorial version is based on the actual deployed version of Hermes, as of the date of publication.
Click to edit Master title style Page - 1 OneSky Teams Step-by-Step Online Corporate Communication Support 2006.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
1 Phase III Secondary Schools Teacher Assistant Basics & Attendance Student Information Services Section April 2008.
How To Use OPAC.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Windows XP Project An Introduction to Microsoft Windows XP and Office 2003.
1. What is it Advantages Process Instructions General Roster Advisor Constitution Interests Categories Photo Profile Navigation News/Events Roster Photos.
1 SLIDE Insurance Company Regulation Division Insurance Market Regulation Division Medical Professional Liability Insurance Claim Reports Online Claim.
Online learning that compliments face-to-face teaching.
Welcome to Access Online for State of Iowa Cardholders.
Southern Connecticut State University Core-CT Time and Labor Employee Self Service: Enter Time – Exception Reporters.
Beginning Keyboarding BSAD B252a to the orientation for the beginning keyboarding class! This presentation gives you important information about the course.
Course Registration Overrides SLCM_WP_220 1SLCM_WP_220 Overrides.
How To Use Google Forms to Create A Test Quick Easy Self-Graded!! Instant Reports.
Smarter Balanced Field Test MARCH 2014 WHITTIER CITY SCHOOL DISTRICT.
ABC Technology Project
PEPS Weekly Data Extracts User Guide September 2006.
Step #1 Go to the PA CareerLink® homepage at and click “New User.”
CAR Training Module PRODUCT REGISTRATION and MANAGEMENT Module 2 - Register a New Document - Without Alternate Formats (Run as a PowerPoint show)
1 Welcome to SAPS Webmail. 2 Things we will learn about: 1. Login to mail.
Media-X eWalk Walkthrough Install Training- Part Two Topic: Uploading Completed Walkthroughs Office of Institutional Education Programs 1.
CMPT 275 Software Engineering
Services Course Windows Live SkyDrive Participant Guide.
How to create a wiki using pbwiki. Step 1: Choose a wiki website I have chosen.
Chapter 5 Test Review Sections 5-1 through 5-4.
Light User Guide BVPortal June 30th, p.m. Charles - Henri Varin KM DTP For the benefit of business and people.
How creating a course on the e-lastic platform 1.
25 seconds left…...
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Services Course Windows Live SkyDrive Participant Guide.
Week 1.
Sedex: Registration and Account Set Up Instructions
WorkKeys Internet Version Training
We will resume in: 25 Minutes.
ACD Training.
1 PART 1 ILLUSTRATION OF DOCUMENTS  Brief introduction to the documents contained in the envelope  Detailed clarification of the documents content.
Created Revised Office of Information, Technology and Accountability 1 Microsoft Access Combos & Command Boxes.
Page 1 of 30 This process involves authorizing a company to act on behalf of the designated representative for a Crown petroleum and natural gas licence.
CS 1150 – Lab #16A & 16B – HTML TA – Sanjaya Wijeratne – Web Page -
Use the buttons on the top to navigate through the presentation 1 PrevNext Menu.
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 6Protecting and Sharing Workbooks.
Know About E-CTLT Teachers Panel and working area.
04/24/2014April 2014 Chapter Meeting1 Forcing IE 10 & 11 to play nicely with Retail Link™ Dan Batson Sr. Analyst / Category Advisor Fujifilm North America.
TIDE Presentation Florida Standards Assessments 1 FSA Regional Trainings Updated 02/09/15.
Columbus State Community College
12-CRS-0106 REVISED 8 FEB 2013 PRESENTS Payment Functionality.
HTML Concepts and Techniques Fourth Edition Project 2 Creating and Editing a Web Page.
Lecture 12 Compound Interest Ana Nora Evans 403 Kerchof Math 1140 Financial Mathematics.
CSE 113 Introduction to Computer Programming Lecture slides for Week 10 Monday, October 31 th, 2011 Instructor: Scott Settembre.
CSE 113 Introduction to Computer Programming Lecture slides for Week 6 Monday, October 3 rd, 2011 Instructor: Scott Settembre.
Getting Started with Moodle Getting Started Logging In Entering Your Address Viewing a Course Navigating Your Course’s Homepage Personalizing Your.
CSE 113 Introduction to Computer Programming Lecture slides for Week 4 Monday, September 19 th, 2011 Instructor: Scott Settembre.
MGS 351 Introduction to Management Information Systems
CSE 113 Introduction to Computer Programming Lecture slides for Week 2 Wednesday, September 7 th, 2011 Instructor: Scott Settembre.
CSE 113 Introduction to Computer Programming Lecture slides for Week 5 Monday, September 26 th, 2011 Instructor: Scott Settembre.
CSE 113 Introduction to Computer Programming Lecture slides for Week 1 Monday, August 29 th, 2011 Instructor: Scott Settembre.
CSE 113 Introduction to Computer Programming Lecture slides for Week 7 Monday, October 10 th, 2011 Instructor: Scott Settembre.
CSE 113 Introduction to Computer Programming Lecture slides for Week 12 Monday, November 14 th, 2011 Instructor: Scott Settembre.
MGS 351 Introduction to Management Information Systems Lecture #1.
How to find your textbooks … ©Wellner Design, 2010.
Introduction to Blackboard Rabie A. Ramadan Session 2.
Presentation transcript:

CSE 113 Introduction to Computer Programming Lecture slides for Week 3 Monday, September 12 th, 2011 Instructor: Scott Settembre

ADMINISTRATION NOTES Section 1 Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 2

Greenfoot Details The Greenfoot resource page that can be found at: I usually put the information we need and copy it to UBLearns, but you may find the link above useful, as well as the following link for additional information, videos, and tips: Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 3

Lab Attendance Lab attendance is definitely mandatory. If you cannot go to your assigned lab (or miss it), then you should ask your TA if you can go instead to another lab time. Lab times are: Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 4 Lab DaySection #TimeTA in charge WedB112-1:50pmBich Vu WedB42-3:50pmTroy Koss ThursB29-10:50amTroy Koss FridayB310-11:50amBich Vu

Contact You can any one of the TA’s for your questions and if they cannot help you, please do me. Remember to include “CSE113:” in the subject line. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 5

Teacher Assistants and Office hours You can find the up-to-date hours and locations in the “Contact” section of UBLearns. Here are the names, s, and office hours as of 9/12/2011: Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 6 Name addressOffice hours (Bell 329) Bich (pronounced “Bic”) (11-11:50pm) Friday (12-12:50pm) Troy (3-5pm) Scott after poll class

UB Helpful Information UB Free Software Using your own computer at UB Help from UB IT FREE Microsoft Software – ALL OF IT! – MSDN-AA developer-network-academic-alliance-msdn-aa Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 7

VERY IMPORTANT! Go to Bell 101 and log in by Monday, September 12 th, – Your username/password is the same as your UB username/password. If you cannot log in, the make sure you get your account enabled. – Either talk to the attendant on duty in Bell 101, OR – Go to: If you go to lab and cannot log in, everyone will point and laugh at you!!! Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 8

You are behind the class if… If you have not completed chapter 1 and started chapter 2, then you are behind the rest of the class. Please do the following: – Attempt setting up and doing chapter 1 and 2 in Bell 101. – If you have too much trouble getting started, then: Go to a TA office hour, OR a TA, OR Go to an additional lab section before you go to your lab. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 9

GETTING STARTED NOTES Section 2 Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 10

Lab Tips from Week 2 If you didn’t have the book at this time, you had the option to use the “tutorial” at the Greenfoot website: In addition, free chapters 2 and 3 could also be downloaded from: Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 11

Greenfoot Scenarios For this course, in order to follow the book, you need to additionally download the book scenarios. I have posted them on UBLearns (guaranteed virus free), or you can download them directly from the book website: (Click the second link in the section marked “For students”) You should create a directory called “greenfoot” and then place the extracted “book-scenarios” directory into that directory. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 12

For those that used the Tutorial… Please quickly do/look through chapter 1 when you get the book to make sure that you understand all the concepts. The tutorial also has some “vague” instructions, including where you should place the code and a change that is fixed if you change all the “.gif” references to “.png”. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 13

CHAPTER 3 Section 3 Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 14

What is a “package”? A package is a bunch of code. – It may be one file or many files. – It may call methods or use objects from any of those files. – Usually, a package contains related objects and there is some dependency. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 15

Can “objects” be created using packaged code? In this course, you will find the answer to this to be “Yes.” However, you do not always need to create an object to use the code in a package. These are called “static” methods. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 16

I’m confused, “static” methods? We have been shown that objects can have methods. We have seen how to call an object method. In the case of “static” methods, these are not part of an instantiated object (a created object), instead they are part of the class. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 17

“static” method demo See that when we call the “getRandom” method, we need to refer to the package name. This “reference” to the method is called “dot notation”. The package name is proceeded by a “.” period and then by the name of the method you wish to call. – For example, “Greenfoot.getRandomNumber(100);” Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 18

What is a “subclass”? A subclass is a more specific instance of its superclass. – A “dog” is more specific than “animal”. – A “dog” object would then have functionality (methods or properties) that are not in “animal”. – For example, a method called “wagTail” could be in the “dog” class, but not the “animal” class, since not all animals have tails. We can create a subclass quite easily in Greenfoot. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 19

New subclass demonstration You create a new subclass by right-clicking on the class and then selecting “new subclass”. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 20

Adding new code to a class To add new code to a class, you will want to put the method signature inside the “code block” of the class. The “code block” is the outer set of curly braces “{“ and “}” The new method must be inside that code block so that the computer knows that it describes a method that belongs to that class. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 21

Adding a new method demo Go to the code of the new class and show where to put any new methods that will be created. Notice how the new method then appears in the dropdown menu of any new object you create of the new class. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 22

Number comparisons In this chapter, you will have the need to compare numbers (or the return values of methods) to other numbers. Java has the following comparison operators: Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 23 OperatorMeaningExample ==Equal to5 == 5 !=Not equal to5 != 2 <Less than2 < 5 >Greater than6 > 4 <=Less than or equal to5 <= 5 >=Greater than or equal to6 >= 6

Comparisons can be used in Boolean Expressions The “if” statement contains a test for a Boolean expression. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 24 public void act() { if ( atWorldEdge() ) { turn(17); } if ( Greenfoot.getRandomNumber(100) < 10 ) { turn(5); } move(); } Notice that the there is a comparison here that compares the return value from the static method “getRandomNumber” to the value 10.

Getting input from users This is one of the more important things to know how to do. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 25 public void checkKeypress() { if (Greenfoot.isKeyDown(“left”)) { turn(-4); } if (Greenfoot.isKeyDown(“right”)) { turn(4); } Notice that “isKeyDown” is a static method of the package “Greenfoot”. You do not have an object called “Greenfoot”.

Lab for this week You will experiment and learn how to use these key concepts. – Making a subclass. – Writing a new method. – Calling “static” methods of a package. – Getting keyboard input. Get to know how to do this, since you will need to understand how to do these things to get a good grade on project 1. Monday, Sept. 12th, 2011 University at Buffalo: CSE 113 Instructor: Scott Settembre 26