Quote for the day: Computational thinking: a fundamental skill for everyone … [It] is … choosing an appropriate representation for a problem or modeling.

Slides:



Advertisements
Similar presentations
1 CS100J. Lecture 2, 25 January 2007 Today’s topic: Objects and classes Reading for this lecture: Section 1.3. It’s most important that you study this.
Advertisements

CS100J Today’s topic: Objects and classes Reading for this lecture: Section 1.3 PLive: Activities 3-3.1, 3-3.2, (not 3-3.3), 3-4.1, Summary.
1 CS Sept. Customizing a class & testing Quiz 2 on Tuesday 15 Sept Purpose of a constructor (slide 5) Evaluating a new expression (slide 6) Fields;
: Susan Barbitta Donna Lemons Guilford Technical Community College.
1 CS100J 1 February Customizing a class & testing Quote for the day: There is no reason anyone would want a computer in their home. - -Ken Olson,
1 Review of classes and subclasses M fast through this material, since by now all have seen it in CS100 or the Java bootcamp First packages Then classes.
CS100J 11 September 2003 Course Management System for CS100J is now populated with students who were pre-registered. Look at course web page to see how.
0 CS100J September 2007 CS100J: 12 weeks programming using Java, 2 using Matlab. David Gries. CS100M: 7 weeks of Matlab and 7 of Java. Daisy Fan. CS100H:
CS100J CS100M is in Kimball Bll. Course Management System for CS100J is now populated with students who were pre-registered. Look at course web page to.
E28: Design Notebooks Role Playing Exercise in Gender Equity and Inclusion in Team-based Design Classes.
1 CS100J 30 January 2007 The class definition Course Management System (CMS) for CS100J is populated with students who were pre-registered. Look at course.
1 CS100J 05 February 2005 Today’s topic: Customizing a class (continued) Quiz 1 is today Quiz 2 is next Tuesday Quote for the day: There is no reason anyone.
How to turn on the robot How to start Bluetooth How to connect to robot How to initialize the robot How to not break the robot Sec Getting Started.
1 CS1130 Spring 2011: David Gries & Walker White Transition to Object-Oriented Programming Assumes programming knowledge in a language like Matlab, C,
1 CS1110 Fall 2011: David Gries & Steve Marschner CS1112: Matlab No prior programming experience One semester of calculus Math- & engineering- type problems.
Quote for the day: Computational thinking: a fundamental skill for everyone … [It] is … choosing an appropriate representation for a problem or modeling.
An Introduction to Textual Programming
1 CS1110 Fall 2010 Instructors: David Gries & Lillian Lee CS1112: Matlab No prior programming experience One semester of calculus Math- & engineering-
CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.
Data Objects (revisited) Recall that values are stored in data objects, and that each data object holds one value of a particular type. Data objects may.
1 CS Sept 2010 Customizing a class Quote for the day: I have traveled the length and breadth of this country and talked with the best people, and.
1 CS1110 Lecture Sept Developing (String-processing) programs; class Vector; wrapper classes Prelim: 7:30-9PM Thursday 7 October. Last name A-K:
CS100J 09 September 2003 Course Management System for CS100J is now populated with students who were pre-registered. Look at course web page to see how.
1 CS1110. Lecture 1, 31 Aug Types, expressions, variables, assignment statements Can’t install DrJava and running a Microsoft operating system? Contact.
CSCI 51 Introduction to Computer Science Dr. Joshua Stough January 20, 2009.
CS100J Spring 2006 CS100J: 11 weeks of programming using Java and 2 weeks using Matlab. David Gries is teaching CS100J. Graeme Bailey is teaching a special.
By the end of this session you should be able to...
0 Teaching Java —with OO first David Gries Computer Science Cornell University Ithaca, NY
CSE8A Lecture2 Check the class web page (and discussion board, linked form webpage) for news and info: cse8a.weebly.com Lab starts this week. Discussion.
1 CS1110 Fall 2011 David Gries, Steve Marschner Reading for this lecture and previous lecture: Sections 1.1, 1.2, 1.3. Lab 1 will give you practice with.
CS/ENGRD 2110 SPRING 2012 Lecture 2: Objects and classes in Java 1.
1 CS1110. Lecture 1, 31 Aug Types, expressions, variables, assignment statements Summary of lectures : On course webpage, click on “Lecture summaries”.
Basic Excel The Purpose of this course is to support the student in learning to how to do calculations using Excel Presented by John Mudie, Ph.D., & Stephanie.
1 CS1110 lecture 4 9 Sept. Customizing a class & testing Classes: fields; getter & setter methods. Secs (p. 45) & 3.1 (pp. 105–110 only) Constructors.
Unit 1 – Improving Productivity Instructions ~ 100 words per box.
1 CS1100 Fall Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems CS100J:
1 CS1110 Fall Instructors: David Gries & Lillian Lee CS1112: Matlab No prior programming experience One semester of calculus Math- & engineering-
Fall 2002CS 150: Intro. to Computing1 Streams and File I/O (That is, Input/Output) OR How you read data from files and write data to files.
1 CS 101 Today’s class will begin about 5 minutes late We will discuss the lab scheduling problems once class starts.
Principled approach to teaching OO first David Gries Computer Science, Cornell 1.
1 CS100J 08 September 2005 Today’s topic: Customizing a class (continued) Quote for the day: There is no reason anyone would want a computer in their home.
1 CS1110 Stepwise refinement, more on classes 24 Sep 2009 Application of String processing and stepwise refinement. Miscellaneous points about classes.
1 CS September 2008 Discussion of Methods: Executing method calls.If-statements. The return statement in a function. Local variables. For this and.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
1 CS1110. Lecture 2, 28 Jan Objects & classes PLive: Activities 3-3.1, 3-3.2, (not 3-3.3), 3-4.1, Summary of lectures: On course page,
CS/ENGRD 2110 SPRING 2016 Lecture 2: Objects and classes in Java 1.
1- How to connect the robot to the pc Sec Getting Started 3- How to move the robot Sec Scribbler movements 4- How to make a turn 11- How to.
1 CS April 2009 Sorting: insertion sort, selection sort, quick sort Do exercises on pp to get familiar with concepts and develop skill.
1 CS1110 Thursday, 10 Feb 2011 Discussion of Methods: Executing method calls. If-statements. The return statement in a function. Local variables. For this.
1 CS100J Spring Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems.
1 CS Sep 2011 Miscellaneous points about classes. More on stepwise refinement. Next: wrapper classes. Section 5.1 of class text Need Help? Make.
1 CS Sept 2010 Customizing a class Quote for the day: I have traveled the length and breadth of this country and talked with the best people, and.
1 CS Sept Customizing a class & testing Quote for the day: There is no reason anyone would want a computer in their home. - -Ken Olson, founder.
CS/ENGRD 2110 Fall 2017 Lecture 2: Objects and classes in Java
CS Feb 2010 Customizing a class
CSC207 Fall 2016.
CS1110 Spring Instructor: David Gries
CSC 221: Computer Programming I Fall 2005
CS1110 Classes, stepwise refinement 23 Sep 2009
CS100J. Lecture 2, 24 September Objects & classes
CS/ENGRD 2110 Spring 2018 Lecture 2: Objects and classes in Java
GUIS: Graphical User Interfaces
CS 1110 Please do this now. Draw three variables on a piece of paper as shown to the right: b 4 c 7 d false Below is a “program” consisting of 3 assignment.
CS100J 06 September 2005 The class definition
CS/ENGRD 2110 Fall 2018 Lecture 2: Objects and classes in Java
Sit next to someone. Today, we do some work in pairs.
CS/ENGRD 2110 Spring 2019 Lecture 2: Objects and classes in Java
Responsibilities CS 4640 Programming Languages for Web Applications
CS/ENGRD 2110 Spring 2019 Lecture 2: Objects and classes in Java
CS Feb 2011 Customizing a class
Presentation transcript:

Quote for the day: Computational thinking: a fundamental skill for everyone … [It] is … choosing an appropriate representation for a problem or modeling the relevant aspects of a problem to make it tractable. Jeannette Wing 1 CS1110. Lecture 2, 2 Sep Objects & classes PLive: Activities 3-3.1, 3-3.2, 3-3. (not 3-3.3), 3-4.1, Reading for this lecture: Sec Study this section, practice what is taught using DrJava over the weekend. Reading for Tuesday, 7 Sep. Sections 1.4, (p. 41); (p. 376).

2 Not receiving s from us from CMS? 1. Not registered in the CMS. Maria Witlox ask her to register you. Needs your 2. Your bounces. Your Cornell acct not set up correctly or place to which you forward it is having trouble. Find out: yourself, see what happens, fix Wed 7:30-9:25pm; Mon 2:30-4:25. AEWs 1-credit AEW sections for CS1110. Two hrs per week. Not remedial. See course website for link. Quiz Tuesday. Everyone get 100.! 1. What is a type? p How do you execute (carry out, perform) the assignment statement? box on p Be able to execute an assignment statement. Consulting starts today. Click “Staff” on course webpage, then the link at bottom of page

3 First-day surveys No programming experience: 158 < 5 months experience:048 > 5 months experience: 047 Total253 62%: no previous experience Most frequent comments: 1. Concern about keeping up, ability to learn programming 2. Excited about learning to program CMS shows 278 students, so we are missing 25 surveys. Those who didn’t turn it in: no need to do so. It’s only to give us a good feel for the makeup of the course, and we have that.

4 Two aspects of a programming language Organization – structure Procedural —commands to do something Example: Recipe book Organization: Several options; here is one: Appetizers list of recipes Beverages list of recipes Soups list of recipes … Procedural: Recipe: sequence of instructions to carry out structural objects classes methods inheritance procedural assignment, return, if-statement iteration (loops) recursion miscellaneous GUIs exception handling Testing/debugging Parts to this course

5 A class is a file-drawer. Contents: manila folders, each containing the same kind of information c1 Patient name L. Lee address New York owes $ manila folder: an object or instance of the class class name Name on tab (here, c1): anything you want, as long as it is unique name, address, owes: variables, called fields of the folder

6 A class is a file-drawer. Contents: manila folders, each containing the same kind of information c1 Patient name L. Lee address New York owes $ Instructions to be carried out by different people: change the name, get the name, bill the patient, receive money from patient, insert teeth xrays into the folder, …

7 A class is a file-drawer. Contents: manila folders, each containing the same kind of information c1 Patient name L. Lee address New York owes $ Instructions to be carried out by different people: methods. Assume getName is a function: it returns a value. Assume deposit is a procedure; it does a task, doesn’t return value getName() deposit(double d)

8 c1 Patient name L. Lee address New York owes $ getName() deposit(double d) pat c1 variable contains the name of the folder pat.getName() function call. Its value is “L. Lee” pat.deposit(250.0); procedure call. Subtract from field owes.

9 c1 Patient name L. Lee address New York owes $ getName() deposit(double d) pat c1 variable contains the name of the folder An expression: create a new folder (put it in file-drawer Patient) and give as the value of the expression the name (on tab) of the folder. pat= new Patient();A statement: evaluate new Patient() pop= new Patient(); and store its value (the name of the new folder) in the variable. pop ?

10 Question: How much time did you spend reading the material for this lecture? A. 0 minutes B minutes, with no distractions C minutes with distractions D. > 10 minutes with no distractions E. > 10 minutes with distractions distraction: listening to music at the same time, watching TV or something on the internet at the same time, etc.

11 c1 Patient name L. Lee address New York owes $ getName()deposit(double d) pat c1 c2 Patient name D. Skorton address New York owes $ getName()deposit(double d) richPat c2 Question: Which call(s) will result in “D. Skorton”? A. pat.getName() B. c1.getName() C. richPat.getName() D. c2.getName() E. both C and D

12 j a0 variable contains name of folder An object (manila folder) of class Javax.swing.JFrame is associated with a window on your computer monitor. It has (among others) these functions: getHeight() getWidth() getX() getY() getTitle() isResizeable() and these procedures: show() hide() setTitle(String) setSize(int, int) setLocation(int, int) setResizable(boolean) In groups of 2, draw an object (manila folder) of this class, and put the name a0 on its tab. You don’t know what the fields are, so don’t draw any. We will demo the use of most of these methods

Comments from last semester 13 I understand classes and objects fairly well, and I thought the file drawer/file folder analogy was very helpful. I think I'm definitely prepared for The folder/file drawer analogy was actually very helpful for a first-time Java programmer in understanding them. I did learn the concept before coming to this class, CS1110 is really what made me understand how objects and classes work. The folder was a great way to learn objects and classes. It simplified a very complex concept. Teaching methods were terrible. … boxes and folders made the subject more confusing than it should be. I'm still a bit dubious about the whole file folders and cabinets thing.

14 j a0 variable contains the name of the folder j= new javax.swing.JFrame(); j.show(); … Expression new JFrame() Create new folder and put in file drawer JFrame. Statement jf= new JFrame(); Create new folder, as above, and place its name in variable jf. Thereafter, use jf. method-name ( arguments, if any ) to call methods of folder (object) jf. Read section 1.3. Practice what we did in class in DrJava. Try the self- review exercises on page 40.

15 package: A collection of classes that are placed in the same directory on your hard drive. Think of it as a room that contains file cabinets with one drawer for each class. package java.io classes having to do with input/output package java.net classes having to do with the internet package java.awt classes having to do with making GUIs package javax.swing newer classes having to do with GUIs ============================================= To reference class JFrame in package javax.swing, use: javax.swing.JFrame Instead: import javax.swing.*; Then use simply JFrame