You ARE NOT ALLOWED To Copy Files!!!. You ARE NOT ALLOWED To Be Told What to Write in the Program.

Slides:



Advertisements
Similar presentations
Karel – Making More Complex Decisions IF / THEN / ELSE IF THEN BEGIN Instructions END ELSE BEGIN Instructions END Do these when test = False Do these when.
Advertisements

1 Note: Original slides provided by and modified for Mr. Smith’s AP Computer Science A classwww.apComputerScience.com.
Copyright, Joseph Bergin
Carl Johnson Financial Literacy Jenks High School.
Chapter 3, Section 2 Checking Accounts.
1 Inheritance in Java Behind the scenes: new Objects from old.
4.02 C Check Writing & Endorsements
CMPUT 101 Lab # 2 September 17, :00 – 16:50.
Karel the Robot -- ITERATE Problem Statement: Karel is told to “take a walk around the block!” Revise Algorithm: Define move ahead 5 streets Define turnright.
Karel The Robot In the beginning… software. Karel the Robot  All robots are controlled by software  Artificially intelligent robots that can “think”
Introduction to Computer Science Returned Values Conditionally Executing Instructions –if instruction –if/else instruction Unit 3.
Polymorphism Are there different ways to solve the Harvester problem? – Robot teams – instead of one robot to solve a problem, let’s get a team of robots.
Introduction to Computer Science Extending Robots’ Vocabularies –New Methods –Top-Down Design –Multiple Robots Unit 2.
Robot? What’s a Robot? Introducing Karel-the-Robot.
Extending the Robot Programming Language In the Robot world 1 mile = 8 blocks Suppose we want a robot to run a marathon (26+ miles)? Does our program have.
Who wants to be a Millionaire? Click to begin game.
Chapter 5 Conditionally Executing Instructions
2-1 Adding Integers Pre-Algebra Warm Up Warm Up Problem of the Day Problem of the Day Lesson Presentation Lesson Presentation.
1 karel_part5_loops Iteration (Loops) Loops repeat a set of instructions Two types of loops: –Definite loops ( for ) perform instructions explicit (known)
Ch. 2 1 Karel – Primitive Instructions Basic tools with which all problems are solved (analogies: LeftSpinngingRobot, RightSpinningRobot, GuardRobot, etc)
Karel J Robot An introduction to BlueJ and Object- Oriented Programming.
1 Classes begin with capital letters (i.e. UrRobot). Methods, objects, and variable names begin with lower case (camelCase) Use indentation to line up.
1 Note: Original slides provided by and modified for Mr. Smith’s AP Computer Science A classwww.apComputerScience.com.
Karel J. Robot A Gentle Introduction to the Art of Object Oriented Programming.
Karel the Robot A Gentle Introduction to the Art of Programming.
Chapter 3, Section 3 ELECTRONIC BANKING.
Lecture 21 CS110 Lecture 2 January 29, 2004 Announcements –hw1 part 1 – due right now –hw1 part 2 – due Tuesday night Questions Agenda –turnin –Object.
1-4 Adding Integers Course 3 Warm Up Warm Up Problem of the Day Problem of the Day Lesson Presentation Lesson Presentation.
Introduction to Java Classes and Objects Bank Account Program.
Thanks to Dr. Kris Schindler for this (and all Karel the Robot slides)
Managing Your Money with a Checking Account
Business Math 3.6 Savings Account.
Karel J. Robot Tool for learning OOP (Lecture covers Ch. 1 and 2)
1 karel_part2_Inheritance Extending Robots Tired of writing turnRight every time you start a new karel project. How do we avoid re-writing code all the.
Banking Example College of Alameda Copyright © 1998 Patrick McDermott.
2-1 Adding Integers Course 3 Warm Up Warm Up Problem of the Day Problem of the Day Lesson Presentation Lesson Presentation.
1 Karel J Robot OOP approach to learning computer science “Its study involves development of the ability to abstract the essential features of a problem.
An Introduction to Checking Accounts
15-100: Introduction to Programming w/ Java * Ananda Gunawardena -- Lecture – School of Computer Science – Phone : (x81559) – Office: Wean Hall.
Chapter 5.  We’ve been using UrRobot – knows only 5 things  Let’s now use a new type of Robot: Robot!  i.e. – public class MileMover extends Robot.
Financial Services and Institutions Name_____________________________ 1.
Introduction to OOP in VB.NET using Robots ACSE Conference, Nov 2004 Michael Devoy Monsignor Doyle C.S.S., Cambridge
GOALS BUSINESS MATH© Thomson/South-WesternLesson 3.2Slide 1 3.2Electronic Banking Record electronic banking transactions Find account balance when banking.
3.7 Money Market and CD Accounts
Extending Karel’s Vocabulary This PPT originated with Dr. Judy Hankins Modifications have been done by Dr. Untch & Dr. Cripps.
1 Note: Original slides provided by and modified for Mr. Smith’s AP Computer Science A classwww.apComputerScience.com.
BALANCING YOUR CHECK REGISTRY LESSON 3. SHORT CLASS DISCUSSION… What does it mean to “balance” something?? ______________________________________________________________.
Introduction to Computer Science
Ch. 2 1 Karel – Primitive Instructions Basic tools with which all problems are solved (analogies: carpentry, geometry) –move() –turnLeft() –putBeeper()
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
MONEY MANAGEMENT VOCABULARY. Budget: an estimate of income and spending for a certain period of time. Budget: an estimate of income and spending for a.
Check Lingo A personal check is a written form that states a written amount to withdraw directly from the payer’s account.
Karel the Robot – Review Primitive Commands move pickbeeper putbeeper turnleft Turnoff Karel’s program statements are separated by a semicolon (;) Copyright.
Compiler Errors Syntax error Lexical Can not resolve/find symbol Can not be applied Execution error Oh wait, a run time error Intent error It ran, but.
Karel the Robot – Review Primitive Commands move pickbeeper putbeeper turnleft Turnoff Karel’s program statements are separated by a semicolon (;) Copyright.
Karel – Primitive Instructions
In the beginning… software
1-4 Adding Integers Warm Up Problem of the Day Lesson Presentation
Copyright © 2008 by Helene G. Kershner
Loops We have already seen instances where a robot needs to repeat instructions to perform a task turnRight(); moveMile(); Harvesting beepers in a field.
Copyright © 2008 by Helene G. Kershner
Karel – Primitive Instructions
Karel J Robot.
CS 106A, Lecture 2 Programming with Karel
Karel the Robot – Making Decisions
A Gentle Introduction to the Art of Object Oriented Programming
Add or Subtract? x =.
Little Man Computer Lesson 2
CSE 111 Karel the Robot.
Karel – Primitive Instructions
Presentation transcript:

You ARE NOT ALLOWED To Copy Files!!!

You ARE NOT ALLOWED To Be Told What to Write in the Program

What IS Allowed? Discussion is allowed, even encouraged – the result of it should be captured in your brains (NOT on paper, nor electronic) You can talk as much as you want and at any level of detail about a problem, but you are not allowed to take any written material from each other You are required to report with whom you have discussed the brain draining insurmountable problem (“discussed”, not just fixed a misspelled variable)

You are required to report with whom you have discussed the program List people with whom you’ve discussed the program in a comment at the beginning of the program

IF SOMEONE COPIES FROM YOU, BOTH OF YOU ARE RESPONSIBLE!

Example – Bank Accounts Bank accounts have a state — attributes, like owner, balance, kind of account Bank accounts (in OOP) can do things — methods, like deposit( ) and withdraw( ) Each bank account is represented by an object Send an object a message to get it to add or subtract money Attributes: owner = John Doe balance = $ kind = Checking Methods: deposit( ) withdraw( ) Attributes: owner = John Doe balance = $ kind = Checking Methods: deposit( ) withdraw( ) Attributes: owner = Frank Oz balance = $ kind = Savings Methods: deposit( ) withdraw( ) Attributes: owner = Frank Oz balance = $ kind = Savings Methods: deposit( ) withdraw( ) Attributes: owner = alice Budd balance = $29.88 kind = Checking Methods: deposit( ) withdraw( ) Attributes: owner = alice Budd balance = $29.88 kind = Checking Methods: deposit( ) withdraw( )

World Details Avenues run north/south  Helpful reminder that Avenues run north/south is that the top of the A points north and the bottom of the v points south. Streets run east/west  Your mental note is that you have a mental note on the direction of avenues

Constructor Details Details of the constructor Robot alice = new Robot(6, 2, East, 1);  Robot is what class Object is being created  alice is the reference to this new Object  new Robot(…..) actually makes a new Object  6 the street  2 the Avenue  East the Direction  1 How many Beepers I do not know why it is up and then over, instead of using Cartesian (x, y) order

Robot alice = new Robot(6, 2, East, 1); Beeper in the Beeper Bag alice move turnLeft pickBeeper putBeeper turnOff move turnLeft pickBeeper putBeeper turnOff alice street = 6 avenue = 2 direction = East num-beepers = 1

Program Development Edit program Compile program Execute program Evaluate results

Program Development Edit program Compile program Execute program Evaluate results Lexical and Syntactic errors Execution errors Intent errors