Lecture 2 Announcements

Size: px
Start display at page:

Download "Lecture 2 Announcements"

Transcription

1

2 Lecture 2 Announcements Home Computers and/or Laptops/Notebooks By now you should have installed Java SE 8 and jgrasp on your computers, set up the becker.jar file, and started working with some of the supplied.java files from Lecture 1. How many have done this successfully? How many have tried to do this and have still not gotten jgrasp to compile and run? If you have your laptops with you, I will stick around for a bit after today's class to see if we can get you up and running. I'll also stick around for a bit after next Wednesday s class. I've added a TROUBLESHOOTING walk-through page to the BIT115 website if you are getting the jgrasp wedge2 PATH error. This should be fixed with the latest version of jgrasp, but just in case IMPORTANT! Always download the.java files from the web site, save them to a local folder, and run them from there. If you try to run them directly off the site, they go in the browser cache and get renamed, and then things won't work! There are other issues to remember, which we'll cover in today's class. NOTE: It is essential that you get jgrasp working on your home machines or laptops if you are going to be successful in this class (unless you are going to do all your coding on the PCs here at the college).

3 Setting Up Cascadia Accounts Online 3

4 Assignment Dates (By Due Date) Assignment 1 (LECTURE 5) Section 1: Monday, January 22 nd The Fickle Finger of Fate Assignment 2 (LECTURE 8) Section 1: Wednesday, January 31 st Assignment 1 Revision (LECTURE 10) Section 1: Wednesday, February 7 th Assignment 2 Revision (LECTURE 12) Section 1: Wednesday, February 14 th Assignment 3 (LECTURE 13) Section 1: Wednesday, February 21 st Assignment 3 Revision (LECTURE 16) Section 1: Monday, March 5 th Assignment 4 (LECTURE 18) NO REVISION AVAILABLE! Section 1: Monday, March 12 th 4

5 It's okay if right now you are feeling somewhat overwhelmed, nervous, confused, or just scared spitless! Hey! You're learning a new language (Java) and a new way of thinking about things, so it is perfectly natural if you're feeling a bit overwhelmed right now, or a bit nervous, or even a bit confused. Knowing this, we'll be taking baby steps for the next few lectures. I'll be holding your hand and walking you through Java and code step-by-step. So: Do not be afraid to ask questions! And: Do not be afraid to come see me during my office hours Tuesdays/Thursdays 9:00am-10:30am either in CC3-321 or CC2-180 Also: please me at cduckett@cascadia.edu if you have any questions. If it concerns code that you are working on please remember to attach the.java file to the so I can have a look to determine where a problem might be. Finally: Once I know the exact days, times, and places, going to the Open Labs for additional one-on-one help is greatly encouraged! 5

6

7 The Best Way to Learn How to Code is to Code! Code a little bit every day! Practice practice practice! Don't be afraid to take chances, try new things, or experiment. Coding knowledge comes by doing, not by wishful-thinking, magic, or osmosis! Take advantage of resources found on the Internet! Google it! It Compiled!

8 Some Sites/Links of Interest Udacity Free Online Courses MIT OpenCourseWare Free Online Courses Coursera Free Online Courses Standford Engineering Everywhere Online CS Courses Academic Earth Online CS Courses Free Code Camp Online CS Courses Khan Academy Free Online Tutorials Code Academy Interactive Code Learning Code School Interactive Code Learning CoderDoJo Code Club Community Code.org Code Club Community Girls Who Code Code Club Community Girl Develop It Code Club Community 8

9 Lecture 2 Reading Topics Reading Assignment for Today Chapter 1.5: Types of Errors Chapter Tracing Code Note: there are BIT 115 Student Open Source Guides that students wrote from previous quarters that may deal with the various topics of your readings and lessons. This is a great tool, and highly recommended! 9

10 Quarter-Long Game Plan: Up until the Mid-Term: 1 st part of the quarter Overview of topics, conceptual understanding, not as much freeform problem-solving After the Mid-Term: 2 nd part of the quarter Focus on learning and more problem-solving on your own 10

11 Save A Copy Of All Work (Highly recommended!) In-Class Exercises, Exams, Quizzes, etc. If you work with someone, make sure each of you gets a copy For In-Class Exercises, you do not have to turn it in (I ll be checking it as I walk around and watch you work) If you lose track of it, and I unintentionally record it incorrectly in StudentTracker, then whatever I ve got will stand as the grade. Best then to save your work for proof, if needed, in the event of a discrepancy. If you do find a grading error in StudentTracker, then please don't hesitate to let me know! 11

12 Quizzes and Exams Starting next lecture, Lecture 3, you should assume that the quizzes and exams will all be 100% pen/pencil-and-paper. You bring the pen or pencil, I ll supply the paper Start Practicing Now (My Mantra: Practice! Practice! Practice!) Try writing code from memory, and/or using Notepad or NotePad++ and then copy-and-pasting into jgrasp to check your work 12

13 H Assignment 1 is due LECTURE 5 O M E W O R K in StudentTracker by midnight It s posted on the website under Assignments It will be due by midnight on day of Lecture 5, Monday, January 22 nd If you are confused, bring your work to class, in electronic form, and we will go over how to hand in (upload) the homework: Student Tracker (We ll go over this in a moment with Rex Winkus ) How to Use Student Tracker (Instructions) If you re stuck, seek help! Talk to the Instructor or a classmate or Open Lab helper me BIT 115: Introduction To Programming 13

14 A Quick "Peek" at Assignment 1 Let's Have a Quick Look at Assignment 1 (so there are no surprises down the road!) Assignment 1 is due LECTURE 5, Monday, January 22 (uploaded to StudentTracker by midnight) What You Need To Turn In to StudentTracker for A1 A1_Part_1.java A1_Part_2.doc A1_Part_3.doc A1_Part_4.doc A1_Part_5.java (You'll create this from Starting_Template.java file) Personal Data Sheet (Optional).java file only (no.class) MS Word.doc MS Word.doc MS Word.doc.java file only (no.class) MS Word.doc 14

15 NO Warm-Up QUIZ TODAY We will have our very first 'warm-up' Quiz starting Lecture 3 BIT 115: Introduction To Programming 15

16 StudentTracker Reminder 16

17 Today s Topics Dissecting the Code: What it means and what it does opening and working with.java Files jgrasp: Another Look Errors: How to find and fix them How to set up a City Tracing Code Predicting What A Program Will Do BEFORE you Run It Important Java and OOP Terms like Class, Object, Method, Parameter, etc BIT 115: Introduction To Programming 17

18 Dissecting the Software Dissecting the Code 18

19 What Happened When You Installed Java Java Virtual Machine (JVM) Consists of Many Different Components (Classes) That Allow Java Programs to Do Different Things 19

20 What Happened When You Installed Java 20

21 What Happened When You Installed jgrasp 21

22 What Happens When You Add Becker.Jar to jgrasp Path 22

23 What Happens When You Add Becker.Jar to jgrasp Path 23

24 Downloading and Working On.java Files Important Always download the.java files from the web site first to a folder on your computer or USB thumb drive before opening and working on them. If you work on files from the browser cache, the file names can be changedunder and thencourse class name Wide will Information no longer match up and your programs won t run correctly. Also the browser cache likes to append numbers to the file name if you have already downloaded that file previously, which also means the class name won t match the file name..java Files Should Be Associated to jgrasp If you have the Java JDK and jgrasp properly installed, the.java files you download from the BIT115 web site should be associated with jgrasp. This means they will appear with with jgrasp G icon. Typically, all you have to do to open a.java file is to simply double-click on it and it will open automatically in jgrasp. Alternatively, you can open jgrasp and select the file from the menu bar through File > Open or else to the simply drag-and-drop the file into the work window. 24

25 Two Types Files for a Compiled Program:.java and.class When you write a Java program, you will do so a GUI* Java compiler like jgrasp which also doubles as an IDE** When writing Java and saving Java code you do so in a.java file which is a basic text file. It contains human readable text code at least it is readable for some humans. When you compile your Java code into a working Java program, it creates a.class file which is what the computers uses to line everything up in memory and to run the program. It does not consist of human readable text, but rather machine code or byte code. The reason that each of your.java files are built inside of classes in the code are so your computer can find and run the program after it is compiled, since the class files that are created contain language only the computer understands. So, in other words, a class is another name for the idea of a mini-program which only becomes real (in the virtual sense) once the program is successfully compiled. * Graphic User Interface ** Integrated Development Environment

26 Another Look 26

27

28

29 Dissecting the Code: What It Means and What It Does (Quiz2.java) // Lecture 2: Quiz 2 Java file for use with the PowerPoint slides ///////////////////////////////////////////////////////////////// import becker.robots.*; public class Quiz2 extends Object { public static void main(string[] args) { City toronto = new City(6, 12); Robot Jo = new Robot(toronto, 3, 0, Direction.SOUTH, 0); new Thing(toronto, 3, 2); new Wall(toronto, 3, 3, Direction.EAST); new Wall(toronto, 3, 3, Direction.NORTH); new Wall(toronto, 3, 3, Direction.SOUTH); } } Jo.turnLeft(); Jo.move(); Jo.move(); Jo.pickThing(); Jo.move(); Jo.putThing(); Let s download and run the Quiz2.java program to see what it does, and then we will go over all of the parts of its code line-by-line and discuss what it means.

30 import becker.robots.*; becker.jar This imports from the becker.jar collection all the classes contained in the robots file so they would be functionally available in Java (JDK) and any code written using it. These classes include the Robot.class, the Thing.class, the City.class, the Wall.class, and over a hundred more. NOTE: Java loads some classes by default into the compiler, while others it does not. Later on we will have to import additional Java classes in our code to get our programs to work 30

31 public class Quiz2 extends Object public class Quiz2 extends Object 'public' so other classes can use it if need be. a 'class' is a blueprint for making 'objects' that can do something 'Quiz2' is the name of the class. It can be any name (but must match file name if it contains main). The program uses this name when it runs to know what 'objects' and 'methods' to use in the program. Java, like other object-orientated languages, supports class inheritance. Inheritance allows one class to "inherit" the properties of another class. For example, all Java objects are inherited from the java.lang.object class which is a fundamental part of Java and the Java libraries. Our Quiz2 class is inheriting the properties of Java's Object class, and so extends its actions and attributes in the program hierarchy. 31

32 Curly Braces '{' and '}' (I call them "Squiggles") All java programs use opener curly braces { and closer curly braces } as part of its program. Every opener curly brace { must have a closer curly brace } or the program will not compile. The curly braces (or as I like to call them "squiggles") are used to separate the program into smaller zones. These zones in programming jargon are called scope. It is always best to line up the squiggles to make it easier to see the scope and also to troubleshoot the code when things are not working as planned. Let's have a look Opener Opener Scope Closer Scope Closer 32

33 Note: main is a method() inside a Class public static void main(string[ ] args) The method is public because it is accessible to the JVM (Java Virtual Machine) to begin execution of the program, and can be accessed by any other class or method. The static keyword signifies the fact that this method can be invoked without creating an instance of that class (an object). Main is called before any objects are made, hence static. void signifies that this method does not return anything. In other words no new or altered data is sent out from it for use by the rest of the program. Nothing is returned, so void. Just like in the C procedural language and other languages, this is the main method in a Java program. When you run a Java program, execution begins in the main method. String is the data type that could be passed to the method, although no data type needs to be passed. An example of a data type is an int or float. The [] represents unknown quantity. args is the name of the parameter. We can pass any number of arguments to this method. 33

34 City toronto = new City(); Names the object Creates the new City object We want to make a new instance of the City class (City.class) found in the becker > robots directory (inside becker.jar) and call this new object toronto The City class contains all the attributes and actions necessary to set up a city when a named city object (like toronto) is created, include shape, size, color, streets, avenues, etc. By itself, the City class can't do anything. It's just a collections of ideas and concepts. You need an object made from the City class (like toronto here) to actually do something with a city. NOTE: In Java, '=' is an assignment operator, and points right to left; "==" is an equals sign. EXAMPLE: x = 1 assigns 1 to variable space x and x == 1 means x equals 1. 34

35 // Lecture 2: Quiz 2 Java file for use with the PowerPoint slides ///////////////////////////////////////////////////////////////// import becker.robots.*; public class Quiz2 extends Object { public static void main(string[] args) { City toronto = new City(6, 12); Robot Jo = new Robot(toronto, 3, 0, Direction.SOUTH, 0); new Thing(toronto, 3, 2); new Wall(toronto, 3, 3, Direction.EAST); new Wall(toronto, 3, 3, Direction.NORTH); new Wall(toronto, 3, 3, Direction.SOUTH); } } Jo.turnLeft(); Jo.move(); Jo.move(); Jo.pickThing(); Jo.move(); Jo.putThing(); 35

36 Now what about the Robot line of code? What does that all mean? Robot Jo = new Robot(toronto, 3, 0, Direction.SOUTH, 0); The best way to figure this out is to have a look at the Becker Library which gives us information about that becker.jar file we are associating with our programs. Referencing the Becker Library will help us to know how the objects of the Robot class are setup and what methods they can use. Let s have a look at the Becker Library! 36

37 Becker Robot Library Using it to determine class setup and method use In the BIT115 website, under the LIBRARIES & SPECIFICATIONS heading, click on the Becker Robot Library link. This link takes you to the Becker Libraries located at: Robot Jo = new Robot(toronto, 3, 0, Direction.SOUTH, 0); 37

38 In the upper left-hand column, select becker.robots, then in the lower left-hand column select Robot to bring up information about the Robot class

39 In the right-hand column, scroll down to the Constructor Summary section. You will see that there are two types of constructor types available for the construction of a Robot object from the Robot class, one that uses four (4) slots and one that uses (5) slots. The four-slot constructor is used when you want to create a Robot object that does not need to work with things (either pick up things or put down things). The five-slot constructor is used when you want to create a Robot object that does work with things (either pick up things or put down things). So what do the four- or five-slot constructors represent? Let s see on the next slide Not to worry: we will talk about constructors and how they work in Lecture 3.

40 The four-slot constructor is used when you want to create a Robot object that does not need to work with things. It has four slots for the City name, Street location, Avenue location, and Direction facing The five-slot constructor is used when you want to create a Robot object that does work with things. It has four slots for the City name, Street location, Avenue location, Direction facing, and Number of Things in its Backpack. Again: we will talk about constructors and how they work in Lecture 3.

41 So, when we see a line of code like this, it is showing us that we are using the 5-slot constructor: Robot Jo = new Robot(toronto, 3, 0, Direction.SOUTH, 0); Again: we will talk about constructors and how they work in Lecture 3.

42 Robot Jo = new Robot(toronto, 0, 3, Direction.NORTH, 0); Names the Robot Creates the new Robot using five parameters Our instance of the Robot object is named Jo Jo is placed in a City called toronto Jo is starting out on Street 3 Jo is starting out on Avenue 0 Jo is starting out facing SOUTH Jo is starting out with 0 (zero) Things in its backpack Now, another way to "construct" this is with only four parameters, by leaving on the number of Things in the backpack Robot Jo = new Robot(toronto, 3, 0, Direction.SOUTH); If you are not going to be picking up or putting down Things in your program, then you can "construct" your Robot without this fifth parameter used by the backpack. Later on, when we start creating our own types of Robots and methods, some of the ICES will be set up in such a way that parts of the code will use five parameters and other parts of the code will use four parameters and this will cause an error. We'll go over this in greater detail when the time comes. 42

43 new Thing(toronto, 3, 2); new Wall(toronto, 3, 3, Direction.EAST); new Wall(toronto, 3, 3, Direction.NORTH); new Wall(toronto, 3, 3, Direction.SOUTH); These will work by default. For stuff that just sits there, we don t have to actually give them unique names (e.g., BrickWall) but we can t talk about them in code, however a Robot can pick up/put down an unnamed object. Why would you want to give a wall a unique name? If you look at the becker library you will discover that Wall actually extends Thing, that is to say Wall has inherited all the initial properties of Thing Jo.move(); move() is one of the methods of the Robot class, along with turnleft(), pickthing(), putthing(), as well as frontisclear(), countthingsinpackback(), and several more. Because Robot class has a move() command, Jo can use move(). BIT 115: Introduction To Programming 43

44 Something to Remember: In parameter order, street comes first and avenue comes second. Streets go West-East (left-right) Avenues go North-South (up-down) A neat trick to remember the difference is to recall that the 'A' and 'V' in Avenue point up and down.

45 Three Types of Errors 45

46 Chapter 1.5: Types of Errors 3 Different General Categories of Errors: Compile-Time Errors (or Syntax Errors) Run-Time Errors (or Application Errors) Intent Errors (or Logical Errors) 46

47 An Historical Side Trip: Why Are Bugs Called Bugs? Use of the term "bug" to describe inexplicable defects has been a part of engineering jargon for many decades and predates computers and computer software; it may have originally been used in hardware engineering to describe mechanical malfunctions. For instance, Thomas Edison wrote the following words in a letter to an associate in 1878: It has been just so in all of my inventions. The first step is an intuition, and comes with a burst, then difficulties arise this thing gives out and [it is] then that "Bugs" as such little faults and difficulties are called show themselves and months of intense watching, study and labor are requisite before commercial success or failure is certainly reached. In 1946, when computer pioneer Grace Hopper joined the Harvard Faculty at the Computation Laboratory to work on the Mark II and Mark III computers. Operators traced an error in the Mark II to a moth trapped in a relay, coining the term bug. This bug was carefully removed and taped to the log book. Stemming from the first bug, today we call errors or glitches in a program a bug. 47

48 48

49 Compile-Time Errors (or Syntax Errors) Anything that goes wrong when you compile the file is a compile-time error! Point out that the Output Panel is often small, but it can be resized, and you should get used to figuring out which line the error pertains to. Java is case sensitive - Java is different from java, is different from JaVa, is different from JAVA - This means you must type names, etc, EXACTLY the same File name MUST be the same as the class name that has the main method You need the import becker.robots.*; at the top of each robot file Forgetting to Compile BEFORE Running - You need to compile the file EVERY SINGLE TIME you change it - You should also wait UNTIL the compilation finishes BEFORE trying to run it Strategy For Fixing Compile-Time Errors: Follow the debugging strategy (listed in your text) to find and correct the syntax errors in the FindErrors.java program later this evening when you do your In-Class Exercises. 1. Compile the program to get a list of errors; 2. Fix the most obvious errors, beginning with the first error reported 3. Compile the program again to get a revised list of the remaining errors. 49

50 Run-Time Errors (Application/Crashing Errors) Anything that causes the software application (jgrasp) to crash while it's running is known as a Run-Time Error. If you encounter a run-time error when you are compiling and running your Java programs, then this would be a jgrasp problem, or a Windows Operating System problem, and NOT a Java Problem. The Java language does a lot to protect you from this type of error, so you shouldn't see many of these. Intent Errors (Logical Errors) The program compiles and runs without crashing, but it does not do what you intended is a Intent Error (also called a Logical Error). Example: - Robot takes an extra leftturn, and runs off the screen - Robot doesn't pick up a Thing when it's supposed to. - Robot collides with a Wall (the book calls this a run-time error, but it technically isn t) As you continue learning to code you'll make fewer "typo" type mistakes, and end up with more Intent errors then Compile-Time errors. You need to come up with a personal strategy to figure out where the Intent problems are, and how to fix them. One Option: Use a Program Debug Table (show where this is on web site) 50

51 Lecture 2 ICE: Finding And Fixing Errors In Your Program In-Class Exercise Directions 2.1 FindErrors.java Program Debug Table We'll Wait and Do All the ICEs Together at the End of Lecture BIT 115: Introduction To Programming 51

52 Lecture 2 ICE: Setting Up a City In-Class Exercise Directions 2.2 Starting_Template.java We'll Wait and Do All ICEs Together at the End of Lecture BIT 115: Introduction To Programming 52

53 Chapter Tracing Code BIT 115: Introduction To Programming 53

54 BIT 115: Introduction To Programming 54

55 BIT 115: Introduction To Programming 55

56 Important Terms to Remember 56

57 Some Important Terms To Remember A class is a set of functions that can work together to accomplish a task. It can contain or manipulate data, but it usually Under does Course so according Wide to a pattern Information rather than a specific implementation. An instance of a class is considered an object. Until an object is instantiated from a class, the class can t actually do anything. An object receives all of the characteristics of a class, including all of its default data and any actions that can be performed by its functions. The object is for use with specific data or to accomplish particular tasks. A method simply refers to a function that is encased in a class. It usually entails an action. A parameter is a variable that is passed into a function that instructs it how to act or gives it information to process. Parameters are also sometimes called arguments. A field or property is a default set of data stored in a class. A class can have multiple properties and can be changed dynamically through the methods of the class. These are sometimes called attributes. Inheritance is one of the keys that make OOP tick. Simply put, classes can inherit methods and fields from other classes by extending them and each class can be extended by multiple classes. This means that you can start with a base (or parent) class that contains shared characteristics among several classes. That base class can then be extended by other classes (children) that are similar but are meant for slightly different purposes. Any changes in the parent class will automatically cascade to its children. BIT 115: Introduction To Programming 57

58 Class (The Idea of Attributes and Actions, Features and Functions) A class is a collection of functions that can work together to accomplish a task. It can contain or manipulate data, but Under it usually Course does so according Wide to a Information pattern rather than a specific implementation. An instance of a class is considered an object. Until an object is instantiated from a class, the class can t actually do anything. Example The Robot class. The Robot class contains all the attributes and actions that a robot might have once it is created (or instantiated) as an object. Until then, all the Robot features and functions are just the idea how a robot might work, but being an idea the class doesn t do any work itself. So, a class is like a blueprint, and an object is what is built from the blueprint. Just like we might have an idea how a car should look and operate body, engine, four tires, steering wheel, gas and brake pedals, etc an idea of a car is not the same of an actual working car. Here the idea of a car is a class, and an actual working car is an object. BIT 115: Introduction To Programming 58

59 "Brakes" "Engine" "Lights" "Transmission" "Wheels" "Chassis" "Seats" "Power" "Car" Class "Car" Object 59

60 "Brakes" No "Wings Here "Engine" "Lights" "Transmission" "Wheels" "Chassis" "Seats" "Power" "Car" Class "Car" Object 60

61 Object (An Instance of the Idea Made Actionable) An object receives all of the characteristics of a class, including all of its default data and any actions that can be performed by its functions. The object is for use with specific data or to accomplish particular tasks. Under Course Wide Information Example When we create an object from the Robot class we do so by creating a named instance of the Robot class that will possess all the features and functions that were outlined as belonging to the Robot class as an idea. Once the object is instantiated, what was once the idea of a Robot now becomes an actual Robot that possesses specific Robot properties (its shape, size, color, speed) and that can perform specific Robot actions (like move, turn left, put down a thing, pick up a thing, etc). BIT 115: Introduction To Programming 61

62 Method (An Action That Might Be Performed by the Object) A method simply refers to a function that is encased in a class. It usually entails an action. Example After we have created a named object from the Robot class that possesses all the properties (or attributes) belonging to robots, the robot can now perform some kind of action or actions (like move, turn left, put down a thing, pick up a thing, etc). These actions are the methods belonging to the Robot classes, and which an instance of the Robot class can perform. A robot can move because the Robot class has a method called move() which will allow the robot to move one space forward each time it is called upon to do so. Although we might want the robot to mix a martini, the robot can not because the Robot class does not contain a mixamartini() method. Later on in this course we will learn how we might make a new kind of class that could contain a mixamartini() method, but the Robot class we are using now does not have just such a method. BIT 115: Introduction To Programming 62

63 Parameter ( Information or Instruction That Might Be Given) A parameter is a variable that is passed into a function that instructs it how to act or gives it information to process. Under Parameters Course are also Wide sometimes Information called arguments. Example When we have a robot object call upon a method in order to perform some action, that method may or may not take a parameter which is an additional piece of information or an instruction that might extend its functionality. Currently most of the methods belonging to the Robot class do not take any parameters (although in a moment we ll look at a Robot method that does take a parameter). For example, the move() method when called upon will allow the robot to move one space forward. You ll notice that the move() method has two empty parentheses which represents that it doesn t take a parameter. Had the programmer of the Robot class designed the move() method differently, then it might have taken a parameter to represent how many places the robot should move. For example move(1) might make the Robot move one space forward, move(2) might make the Robot move two spaces forward, move(3) might make the robot move three spaces forward, and so on. Since the programmer did not design the move() method this way, using the move() method like this will not work. This was only a theoretical example. 63

64 Field or Property (The Attributes of Class and Its Objects) A field or property is a default set of data stored in a class. A class can have multiple properties and can Under Course Wide Information be changed dynamically through the methods of the class. These are sometimes called attributes. Example When we create a named instance of a robot from the Robot class, this robot object comes with a set of predefined properties and attributes. For example, by default the new robot object is so many pixels high and so many pixels wide, its shape is an arrowhead, its color is red, and its location and placement and direction in the City is defined by the parameters that were passed to it (which we will discuss in the next Dissecting the Code section). For example, one of the properties of the Robot class is that a robot will move one space forward in.5 seconds. This speed,.5 seconds, is a pre-defined property of the Robot class and any instances of objects made using the Robot class. Now these pre-defined properties might be changed dynamically while the program is running if just such a feature was developed programmatically to do so. In the case of the robot s default speed of.5 seconds for every move, there is a setspeed() method which can be used to change the robot s initially defined speed. For example setspeed(4) will move the Robot twice as fast (the default speed is 2). 64

65 Inheritance (Extending a Class s Features to a New Class ) Inheritance is one of the keys that make Object-Oriented Programming tick. Simply put, classes can inherit methods and fields from other classes by extending them and each class can be extended by multiple classes. Under This means Course that youwide can startinformation with a base (or parent) class that contains shared characteristics among several classes. That base class can then be extended by other classes (children) that are similar but are meant for slightly different purposes. Any changes in the parent class will automatically cascade to its children. Example We will learn about inheritance and how to put it to good use next week. A brief example what inheritance is can be explained by looking at our Robot class. Right now the Robot class has a turnleft() method but it does not have a turnright() method. If you created a Robot object and wanted it to turn right then you would have to call upon it to turn left three times! Now we might create a new type of Robot class (perhaps called MrRoboto) that would extend all the features and functions of the Robot class (like move(), turnleft(), etc) and also create its own new set of methods (like turnaround(), turnright(), etc). In this example we are using the original Robot class to create our new MrRoboto class, and as such the MrRoboto class is inheriting all the original features and functions of the Robot class. This is a great tool of Object Oriented Programming (or OOP) because this means the programmer doesn t have to code all the Robot class features and functions from scratch to use in the new MrRoboto class. All the programmer has to do is code the new methods (like turnaround() or turnright()) since the MrRoboto class inherited all the original methods (like move(), turnleft(), etc). 65

66 In-Class Exercises (ICEs) Working on In-Class Exercises is essential for learning how to program or code and they have been designed to help you with the Assignments. Today I ve dedicated a lot of time to working on the ICEs so I can see how each of you are coming along. Now is the time to ask questions about anything to do with the ICEs, or seek clarification, or to get confirmation that you re on the right track. In-Class Exercise 2.1 In-Class Exercise 2.2 In-Class Exercise 2.3 IMPORTANT! CityFrame: An older version of becker.jar file contained a class called CityFrame which when used looked something like this: CityFrame City = CityFrame(seattle); This old code will rear its ugly head in the ICEs on purpose as an example of 'legacy' code that no longer belongs in the program. When you see it, it should either be "commented out" or deleted altogether since it will not allow the program to run correctly!

67

BIT 115: Introduction To Programming LECTURE 3. Instructor: Craig Duckett

BIT 115: Introduction To Programming LECTURE 3. Instructor: Craig Duckett BIT 115: Introduction To Programming LECTURE 3 Instructor: Craig Duckett cduckett@cascadia.edu Lecture 3 Announcements By now everyone should be up and running with Java, jgrasp, and the Becker Robots

More information

Lecture 6. Instructor: Craig Duckett

Lecture 6. Instructor: Craig Duckett Lecture 6 Instructor: Craig Duckett Assignment 1, 2, and A1 Revision Assignment 1 I have finished correcting and have already returned the Assignment 1 submissions. If you did not submit an Assignment

More information

Lecture 7. Instructor: Craig Duckett OUTPUT

Lecture 7. Instructor: Craig Duckett OUTPUT Lecture 7 Instructor: Craig Duckett OUTPUT Lecture 7 Announcements ASSIGNMENT 2 is due LECTURE 8 NEXT LECTURE uploaded to StudentTracker by midnight Assignment 2!!! Assignment Dates (By Due Date) Assignment

More information

Asking For Help. BIT 115: Introduction To Programming 1

Asking For Help. BIT 115: Introduction To Programming 1 Asking For Help Start homeworks As Soon As Possible You may post homework questions to Canvas: Please do not cut and paste entire lines of code, but rather ask conceptual questions. You may also ask me

More information

Instructor: Craig Duckett

Instructor: Craig Duckett Instructor: Craig Duckett cduckett@cascadia.edu Announcements Assignment 1 Due Lecture 5 by MIDNIGHT I will double dog dare try to have Assignment 1 graded and back to you by Wednesday, January 24 th hopefully

More information

Title: Logical operators: NOT!

Title: Logical operators: NOT! Title: Logical operators: NOT! By Adrian Hunter Assignment Definition and General Feedback by Michael Panitz at Cascadia Community College (http://www.cascadia.edu) Table of contents: Quick Summary * When

More information

Title: Counting While Loops

Title: Counting While Loops Title: Counting While Loops Erik Boling, Panitz, Bit115, Winter Quarter 2011 Assignment Definition And General Feedback By Michael Panitz at Cascadia Community College (http://www.cascadia.edu) Table of

More information

Lecture 10. Instructor: Craig Duckett

Lecture 10. Instructor: Craig Duckett Lecture 10 Instructor: Craig Duckett Announcements Assignment 1 Revision DUE TONIGHT in StudentTracker by midnight If you have not yet submitted an Assignment 1, this is your last chance to do so to earn

More information

Lecture 11. Instructor: Craig Duckett. Instance Variables

Lecture 11. Instructor: Craig Duckett. Instance Variables Lecture 11 Instructor: Craig Duckett Instance Variables Assignment Dates (By Due Date) Assignment 1 (LECTURE 5) GRADED! Section 1: Monday, January 22 nd Assignment 2 (LECTURE 8) GRADED! Section 1: Wednesday,

More information

Lecture 12. Instructor: Craig Duckett

Lecture 12. Instructor: Craig Duckett Lecture 12 Instructor: Craig Duckett Assignment 2 Revision DUE TONIGHT! Uploaded to StudentTracker by midnight YOUR LAST CHANCE TO EARN POINTS! Assignment 3 Maze DUE Lecture 13 Uploaded to StudentTracker

More information

contain a geometry package, and so on). All Java classes should belong to a package, and you specify that package by typing:

contain a geometry package, and so on). All Java classes should belong to a package, and you specify that package by typing: Introduction to Java Welcome to the second CS15 lab! By now we've gone over objects, modeling, properties, attributes, and how to put all of these things together into Java classes. It's perfectly okay

More information

Slide 1 CS 170 Java Programming 1 Testing Karel

Slide 1 CS 170 Java Programming 1 Testing Karel CS 170 Java Programming 1 Testing Karel Introducing Unit Tests to Karel's World Slide 1 CS 170 Java Programming 1 Testing Karel Hi Everybody. This is the CS 170, Java Programming 1 lecture, Testing Karel.

More information

Assignment Definition And General Feedback By Michael Panitz at Cascadia Community College (

Assignment Definition And General Feedback By Michael Panitz at Cascadia Community College ( For Loops: Will Tanna Assignment Definition And General Feedback By Michael Panitz at Cascadia Community College (http://www.cascadia.edu) Table of contents: Summary When To Use and Avoid This Example

More information

Laboratory 1: Eclipse and Karel the Robot

Laboratory 1: Eclipse and Karel the Robot Math 121: Introduction to Computing Handout #2 Laboratory 1: Eclipse and Karel the Robot Your first laboratory task is to use the Eclipse IDE framework ( integrated development environment, and the d also

More information

Instructor: Craig Duckett. Lecture 04: Thursday, April 5, Relationships

Instructor: Craig Duckett. Lecture 04: Thursday, April 5, Relationships Instructor: Craig Duckett Lecture 04: Thursday, April 5, 2018 Relationships 1 Assignment 1 is due NEXT LECTURE 5, Tuesday, April 10 th in StudentTracker by MIDNIGHT MID-TERM EXAM is LECTURE 10, Tuesday,

More information

Intro. Scheme Basics. scm> 5 5. scm>

Intro. Scheme Basics. scm> 5 5. scm> Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if

More information

Lecture 8 " INPUT " Instructor: Craig Duckett

Lecture 8  INPUT  Instructor: Craig Duckett Lecture 8 " INPUT " Instructor: Craig Duckett Assignments Assignment 2 Due TONIGHT Lecture 8 Assignment 1 Revision due Lecture 10 Assignment 2 Revision Due Lecture 12 We'll Have a closer look at Assignment

More information

ASSIGNMENT 4 Classes and Objects

ASSIGNMENT 4 Classes and Objects ASSIGNMENT 4 Classes and Objects COMP-202A, Fall 2010, All Sections Due: Friday, November 19, 2010 (23:55) You MUST do this assignment individually and, unless otherwise specified, you MUST follow all

More information

ALICE: An introduction to progamming

ALICE: An introduction to progamming ALICE: An introduction to progamming What is Computer Science? Computer Science Do you know the difference between ICT and Computer Science? Any suggestions as to what jobs you could do if you were a Computer

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG 1 Notice Class Website http://www.cs.umb.edu/~jane/cs114/ Reading Assignment Chapter 1: Introduction to Java Programming

More information

Combo Lecture Lecture 14/15. Instructor: Craig Duckett

Combo Lecture Lecture 14/15. Instructor: Craig Duckett Combo Lecture Lecture 14/15 Instructor: Craig Duckett Assignment Dates (By Due Date) Assignment 1 (LECTURE 5) GRADED! Section 1: Monday, January 22 nd Assignment 2 (LECTURE 8) GRADED! Section 1: Wednesday,

More information

Jerry Cain Handout #5 CS 106AJ September 30, Using JSKarel

Jerry Cain Handout #5 CS 106AJ September 30, Using JSKarel Jerry Cain Handout #5 CS 106AJ September 30, 2017 Using JSKarel This handout describes how to download and run the JavaScript version of Karel that we ll be using for our first assignment. 1. Getting started

More information

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed

More information

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics COMP-202 Unit 1: Introduction Announcements Did you miss the first lecture? Come talk to me after class. If you want

More information

ASSIGNMENT 3 Classes, Objects and the Robot World

ASSIGNMENT 3 Classes, Objects and the Robot World ASSIGNMENT 3 Classes, Objects and the Robot World COMP-202B, Winter 2009, All Sections Due: Tuesday, March 3, 2009 (23:55) You MUST do this assignment individually and, unless otherwise specified, you

More information

Slide 1 CS 170 Java Programming 1

Slide 1 CS 170 Java Programming 1 CS 170 Java Programming 1 Objects and Methods Performing Actions and Using Object Methods Slide 1 CS 170 Java Programming 1 Objects and Methods Duration: 00:01:14 Hi Folks. This is the CS 170, Java Programming

More information

CS Problem Solving and Object-Oriented Programming

CS Problem Solving and Object-Oriented Programming CS 101 - Problem Solving and Object-Oriented Programming Lab 5 - Draw a Penguin Due: October 28/29 Pre-lab Preparation Before coming to lab, you are expected to have: Read Bruce chapters 1-3 Introduction

More information

ASSIGNMENT 4 Records and Objects

ASSIGNMENT 4 Records and Objects ASSIGNMENT 4 Records and Objects COMP-202B, Winter 2010, All Sections Due: Wednesday, March 31, 2010 (23:55) You MUST do this assignment individually and, unless otherwise specified, you MUST follow all

More information

CS125 : Introduction to Computer Science. Lecture Notes #4 Type Checking, Input/Output, and Programming Style

CS125 : Introduction to Computer Science. Lecture Notes #4 Type Checking, Input/Output, and Programming Style CS125 : Introduction to Computer Science Lecture Notes #4 Type Checking, Input/Output, and Programming Style c 2005, 2004, 2002, 2001, 2000 Jason Zych 1 Lecture 4 : Type Checking, Input/Output, and Programming

More information

This course supports the assessment for Scripting and Programming Applications. The course covers 4 competencies and represents 4 competency units.

This course supports the assessment for Scripting and Programming Applications. The course covers 4 competencies and represents 4 competency units. This course supports the assessment for Scripting and Programming Applications. The course covers 4 competencies and represents 4 competency units. Introduction Overview Advancements in technology are

More information

Assignment #1: /Survey and Karel the Robot Karel problems due: 1:30pm on Friday, October 7th

Assignment #1:  /Survey and Karel the Robot Karel problems due: 1:30pm on Friday, October 7th Mehran Sahami Handout #7 CS 06A September 8, 06 Assignment #: Email/Survey and Karel the Robot Karel problems due: :0pm on Friday, October 7th Email and online survey due: :9pm on Sunday, October 9th Part

More information

Tips from the experts: How to waste a lot of time on this assignment

Tips from the experts: How to waste a lot of time on this assignment Com S 227 Spring 2018 Assignment 1 100 points Due Date: Friday, September 14, 11:59 pm (midnight) Late deadline (25% penalty): Monday, September 17, 11:59 pm General information This assignment is to be

More information

Student Success Guide

Student Success Guide Student Success Guide Contents Like a web page, links in this document can be clicked and they will take you to where you want to go. Using a Mouse 6 The Left Button 6 The Right Button 7 The Scroll Wheel

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG 1 Notice Reading Assignment Chapter 1: Introduction to Java Programming Homework 1 It is due this coming Sunday

More information

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet. Mr G s Java Jive #2: Yo! Our First Program With this handout you ll write your first program, which we ll call Yo. Programs, Classes, and Objects, Oh My! People regularly refer to Java as a language that

More information

Mehran Sahami Handout #7 CS 106A September 24, 2014

Mehran Sahami Handout #7 CS 106A September 24, 2014 Mehran Sahami Handout #7 CS 06A September, 0 Assignment #: Email/Survey and Karel the Robot Karel problems due: :pm on Friday, October rd Email and online survey due: :9pm on Sunday, October th Part I

More information

CS112 Lecture: Defining Instantiable Classes

CS112 Lecture: Defining Instantiable Classes CS112 Lecture: Defining Instantiable Classes Last revised 2/3/05 Objectives: 1. To describe the process of defining an instantiable class 2. To discuss public and private visibility modifiers. Materials:

More information

Project 1 Balanced binary

Project 1 Balanced binary CMSC262 DS/Alg Applied Blaheta Project 1 Balanced binary Due: 7 September 2017 You saw basic binary search trees in 162, and may remember that their weakness is that in the worst case they behave like

More information

Lab 1: Introduction to Java

Lab 1: Introduction to Java Lab 1: Introduction to Java Welcome to the first CS15 lab! In the reading, we went over objects, methods, parameters and how to put all of these things together into Java classes. It's perfectly okay if

More information

Lecture 1: Overview

Lecture 1: Overview 15-150 Lecture 1: Overview Lecture by Stefan Muller May 21, 2018 Welcome to 15-150! Today s lecture was an overview that showed the highlights of everything you re learning this semester, which also meant

More information

Arduino IDE Friday, 26 October 2018

Arduino IDE Friday, 26 October 2018 Arduino IDE Friday, 26 October 2018 12:38 PM Looking Under The Hood Of The Arduino IDE FIND THE ARDUINO IDE DOWNLOAD First, jump on the internet with your favorite browser, and navigate to www.arduino.cc.

More information

Using Karel with Eclipse

Using Karel with Eclipse Chris Piech Handout #3 CS 106A January 10, 2018 Using Karel with Eclipse Based on a handout by Eric Roberts and Nick Troccoli Once you have downloaded a copy of Eclipse as described on the course website,

More information

1 of 5 5/11/2006 12:10 AM CS 61A Spring 2006 Midterm 2 solutions 1. Box and pointer. Note: Please draw actual boxes, as in the book and the lectures, not XX and X/ as in these ASCII-art solutions. Also,

More information

The first program: Little Crab

The first program: Little Crab Chapter 2 The first program: Little Crab topics: concepts: writing code: movement, turning, reacting to the screen edges source code, method call, parameter, sequence, if-statement In the previous chapter,

More information

HTML/CSS Lesson Plans

HTML/CSS Lesson Plans HTML/CSS Lesson Plans Course Outline 8 lessons x 1 hour Class size: 15-25 students Age: 10-12 years Requirements Computer for each student (or pair) and a classroom projector Pencil and paper Internet

More information

Assignment #1: and Karel the Robot Karel problems due: 3:15pm on Friday, October 4th due: 11:59pm on Sunday, October 6th

Assignment #1:  and Karel the Robot Karel problems due: 3:15pm on Friday, October 4th  due: 11:59pm on Sunday, October 6th Mehran Sahami Handout #7 CS 06A September, 0 Assignment #: Email and Karel the Robot Karel problems due: :pm on Friday, October th Email due: :9pm on Sunday, October 6th Part I Email Based on a handout

More information

Week - 01 Lecture - 04 Downloading and installing Python

Week - 01 Lecture - 04 Downloading and installing Python Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 04 Downloading and

More information

MITOCW watch?v=flgjisf3l78

MITOCW watch?v=flgjisf3l78 MITOCW watch?v=flgjisf3l78 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To

More information

AP Computer Science Summer Work Mrs. Kaelin

AP Computer Science Summer Work Mrs. Kaelin AP Computer Science Summer Work 2018-2019 Mrs. Kaelin jkaelin@pasco.k12.fl.us Welcome future 2018 2019 AP Computer Science Students! I am so excited that you have decided to embark on this journey with

More information

Summer Assignment for AP Computer Science. Room 302

Summer Assignment for AP Computer Science. Room 302 Fall 2016 Summer Assignment for AP Computer Science email: hughes.daniel@north-haven.k12.ct.us website: nhhscomputerscience.com APCS is your subsite Mr. Hughes Room 302 Prerequisites: You should have successfully

More information

Week 3: Objects, Input and Processing

Week 3: Objects, Input and Processing CS 170 Java Programming 1 Week 3: Objects, Input and Processing Learning to Create Objects Learning to Accept Input Learning to Process Data What s the Plan? Topic I: Working with Java Objects Learning

More information

CS112 Lecture: Defining Classes. 1. To describe the process of defining an instantiable class

CS112 Lecture: Defining Classes. 1. To describe the process of defining an instantiable class CS112 Lecture: Defining Classes Last revised 2/3/06 Objectives: 1. To describe the process of defining an instantiable class Materials: 1. BlueJ SavingsAccount example project 2. Handout of code for SavingsAccount

More information

The compiler is spewing error messages.

The compiler is spewing error messages. Appendix B Debugging There are a few different kinds of errors that can occur in a program, and it is useful to distinguish between them in order to track them down more quickly. Compile-time errors are

More information

CSCI 1100L: Topics in Computing Lab Lab 1: Introduction to the Lab! Part I

CSCI 1100L: Topics in Computing Lab Lab 1: Introduction to the Lab! Part I CSCI 1100L: Topics in Computing Lab Lab 1: Introduction to the Lab! Part I Welcome to your CSCI-1100 Lab! In the fine tradition of the CSCI-1100 course, we ll start off the lab with the classic bad joke

More information

Lecture 17. Instructor: Craig Duckett. Passing & Returning Arrays

Lecture 17. Instructor: Craig Duckett. Passing & Returning Arrays Lecture 17 Instructor: Craig Duckett Passing & Returning Arrays Assignment Dates (By Due Date) Assignment 1 (LECTURE 5) GRADED! Section 1: Monday, January 22 nd Assignment 2 (LECTURE 8) GRADED! Section

More information

Variables and Classes. In which we over-ride the super class, work with multiple classes, and move towards non-robot based programming

Variables and Classes. In which we over-ride the super class, work with multiple classes, and move towards non-robot based programming Variables and Classes In which we over-ride the super class, work with multiple classes, and move towards non-robot based programming Classes Class extends Class attributes:

More information

Lines of Symmetry. Grade 3. Amy Hahn. Education 334: MW 8 9:20 a.m.

Lines of Symmetry. Grade 3. Amy Hahn. Education 334: MW 8 9:20 a.m. Lines of Symmetry Grade 3 Amy Hahn Education 334: MW 8 9:20 a.m. GRADE 3 V. SPATIAL SENSE, GEOMETRY AND MEASUREMENT A. Spatial Sense Understand the concept of reflection symmetry as applied to geometric

More information

CS 170 Java Programming 1. Week 12: Creating Your Own Types

CS 170 Java Programming 1. Week 12: Creating Your Own Types CS 170 Java Programming 1 Week 12: Creating Your Own Types What s the Plan? Topic 1: A Little Review Work with loops to process arrays Write functions to process 2D Arrays in various ways Topic 2: Creating

More information

Tips from the experts: How to waste a lot of time on this assignment

Tips from the experts: How to waste a lot of time on this assignment Com S 227 Spring 2018 Assignment 1 80 points Due Date: Friday, February 2, 11:59 pm (midnight) Late deadline (25% penalty): Monday, February 5, 11:59 pm General information This assignment is to be done

More information

Using the API: Introductory Graphics Java Programming 1 Lesson 8

Using the API: Introductory Graphics Java Programming 1 Lesson 8 Using the API: Introductory Graphics Java Programming 1 Lesson 8 Using Java Provided Classes In this lesson we'll focus on using the Graphics class and its capabilities. This will serve two purposes: first

More information

Getting Started (1.8.7) 9/2/2009

Getting Started (1.8.7) 9/2/2009 2 Getting Started For the examples in this section, Microsoft Windows and Java will be used. However, much of the information applies to other operating systems and supported languages for which you have

More information

CS112 Lecture: Introduction to Karel J. Robot

CS112 Lecture: Introduction to Karel J. Robot CS112 Lecture: Introduction to Karel J. Robot Last revised 1/17/08 Objectives: 1. To introduce Karel J. Robot as an example of an object-oriented system. 2. To explain the mechanics of writing simple Karel

More information

6.001 Notes: Section 15.1

6.001 Notes: Section 15.1 6.001 Notes: Section 15.1 Slide 15.1.1 Our goal over the next few lectures is to build an interpreter, which in a very basic sense is the ultimate in programming, since doing so will allow us to define

More information

Shorthand for values: variables

Shorthand for values: variables Chapter 2 Shorthand for values: variables 2.1 Defining a variable You ve typed a lot of expressions into the computer involving pictures, but every time you need a different picture, you ve needed to find

More information

Soda Machine Laboratory

Soda Machine Laboratory Soda Machine Laboratory Introduction This laboratory is intended to give you experience working with multiple queue structures in a familiar real-world setting. The given application models a soda machine

More information

Hello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications

Hello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications Hello World! Computer Programming for Kids and Other Beginners by Warren Sande and Carter Sande Chapter 1 Copyright 2009 Manning Publications brief contents Preface xiii Acknowledgments xix About this

More information

Instructor: Craig Duckett. Lecture 02: Thursday, March 29 th, 2018 SQL Basics and SELECT, FROM, WHERE

Instructor: Craig Duckett. Lecture 02: Thursday, March 29 th, 2018 SQL Basics and SELECT, FROM, WHERE Instructor: Craig Duckett Lecture 02: Thursday, March 29 th, 2018 SQL Basics and SELECT, FROM, WHERE 1 Assignment 1 is due LECTURE 5, Tuesday, April 10 th, 2018 in StudentTracker by MIDNIGHT MID-TERM EXAM

More information

Taskbar: Working with Several Windows at Once

Taskbar: Working with Several Windows at Once Taskbar: Working with Several Windows at Once Your Best Friend at the Bottom of the Screen How to Make the Most of Your Taskbar The taskbar is the wide bar that stretches across the bottom of your screen,

More information

Java Programming Constructs Java Programming 2 Lesson 1

Java Programming Constructs Java Programming 2 Lesson 1 Java Programming Constructs Java Programming 2 Lesson 1 Course Objectives Welcome to OST's Java 2 course! In this course, you'll learn more in-depth concepts and syntax of the Java Programming language.

More information

feel free to poke around and change things. It's hard to break anything in a Moodle course, and even if you do it's usually easy to fix it.

feel free to poke around and change things. It's hard to break anything in a Moodle course, and even if you do it's usually easy to fix it. Teacher s Manual Teacher Manual This page is a very quick guide to creating online courses with Moodle. It outlines the main functions that are available, as well as some of the main decisions you'll need

More information

PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between

PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between MITOCW Lecture 10A [MUSIC PLAYING] PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between all these high-level languages like Lisp and the query

More information

MITOCW watch?v=9h6muyzjms0

MITOCW watch?v=9h6muyzjms0 MITOCW watch?v=9h6muyzjms0 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To

More information

Introduction to Programming

Introduction to Programming CHAPTER 1 Introduction to Programming Begin at the beginning, and go on till you come to the end: then stop. This method of telling a story is as good today as it was when the King of Hearts prescribed

More information

Cmpt 101 Lab 1 - Outline

Cmpt 101 Lab 1 - Outline Cmpt 101 Lab 1 - Outline Instructions: Work through this outline completely once directed to by your Lab Instructor and fill in the Lab 1 Worksheet as indicated. Contents PART 1: GETTING STARTED... 2 PART

More information

Computer Science 210: Data Structures

Computer Science 210: Data Structures Computer Science 210: Data Structures Welcome to Data Structures! Data structures are fundamental building blocks of algorithms and programs Csci 210 is a study of data structures design efficiency implementation

More information

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA 1 TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared

More information

Structured Programming

Structured Programming CS 170 Java Programming 1 Objects and Variables A Little More History, Variables and Assignment, Objects, Classes, and Methods Structured Programming Ideas about how programs should be organized Functionally

More information

Get JAVA. I will just tell you what I did (on January 10, 2017). I went to:

Get JAVA. I will just tell you what I did (on January 10, 2017). I went to: Get JAVA To compile programs you need the JDK (Java Development Kit). To RUN programs you need the JRE (Java Runtime Environment). This download will get BOTH of them, so that you will be able to both

More information

CSE 142. Lecture 1 Course Introduction; Basic Java. Portions Copyright 2008 by Pearson Education

CSE 142. Lecture 1 Course Introduction; Basic Java. Portions Copyright 2008 by Pearson Education CSE 142 Lecture 1 Course Introduction; Basic Java Welcome Today: Course mechanics A little about computer science & engineering (CSE) And how this course relates Java programs that print text 2 Handouts

More information

We know have to navigate between Karel s World view, Karel s Program view and Karel s Execution (or Run) view.

We know have to navigate between Karel s World view, Karel s Program view and Karel s Execution (or Run) view. We know how to write programs using Karel s primitive commands move turnleft pickbeeper putbeeper turnoff We know have to navigate between Karel s World view, Karel s Program view and Karel s Execution

More information

COMP 105 Homework: Type Systems

COMP 105 Homework: Type Systems Due Tuesday, March 29, at 11:59 PM (updated) The purpose of this assignment is to help you learn about type systems. Setup Make a clone of the book code: git clone linux.cs.tufts.edu:/comp/105/build-prove-compare

More information

code-it.co.uk Exploring Regular 2D Shapes & Patterns using sequence, repetition, nested loops, Program Aim: Program regular 2D shapes

code-it.co.uk Exploring Regular 2D Shapes & Patterns using sequence, repetition, nested loops, Program Aim: Program regular 2D shapes code-it.co.uk Exploring Regular 2D Shapes & Patterns Program Aim: Program regular 2D shapes using sequence, repetition, nested loops, simple and complex procedure. Programming Concepts -Sequence -Repetition

More information

Lab # 2. For today s lab:

Lab # 2. For today s lab: 1 ITI 1120 Lab # 2 Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot 1 For today s lab: Go the course webpage Follow the links to the lab notes for Lab 2. Save all the java programs you

More information

BM214E Object Oriented Programming Lecture 4

BM214E Object Oriented Programming Lecture 4 BM214E Object Oriented Programming Lecture 4 Computer Numbers Integers (byte, short, int, long) whole numbers exact relatively limited in magnitude (~10 19 ) Floating Point (float, double) fractional often

More information

Debugging with Karel

Debugging with Karel Colin Kincaid Handout #4 CS 106A June 27, 2018 Debugging with Karel Based on a handout by Mehran Sahami, Eric Roberts and Nick Parlante. For a different walkthrough of this problem, please see Colin Kincaid

More information

Laboratory 5: Implementing Loops and Loop Control Strategies

Laboratory 5: Implementing Loops and Loop Control Strategies Laboratory 5: Implementing Loops and Loop Control Strategies Overview: Objectives: C++ has three control structures that are designed exclusively for iteration: the while, for and do statements. In today's

More information

CS 051 Homework Laboratory #2

CS 051 Homework Laboratory #2 CS 051 Homework Laboratory #2 Dirty Laundry Objective: To gain experience using conditionals. The Scenario. One thing many students have to figure out for the first time when they come to college is how

More information

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software.

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software. Introduction to Netbeans This document is a brief introduction to writing and compiling a program using the NetBeans Integrated Development Environment (IDE). An IDE is a program that automates and makes

More information

Downloading & Installing the BIT115 Software & Programs JAVA JDK SE JGRASP BECKER.JAR ROBOTS TEXTBOOK PDFS

Downloading & Installing the BIT115 Software & Programs JAVA JDK SE JGRASP BECKER.JAR ROBOTS TEXTBOOK PDFS Downloading & Installing the BIT115 Software & Programs JAVA JDK SE JGRASP BECKER.JAR ROBOTS TEXTBOOK PDFS The Java JDK SE 1. Go to http://www.oracle.com/technetwork/java/javase/downloads/index.html and

More information

BM214E Object Oriented Programming Lecture 8

BM214E Object Oriented Programming Lecture 8 BM214E Object Oriented Programming Lecture 8 Instance vs. Class Declarations Instance vs. Class Declarations Don t be fooled. Just because a variable might be declared as a field within a class that does

More information

GeographyPortal Instructor Quick Start World Regional Geography Without Subregions, Fifth Edition Pulsipher

GeographyPortal Instructor Quick Start World Regional Geography Without Subregions, Fifth Edition Pulsipher GeographyPortal Instructor Quick Start World Regional Geography Without Subregions, Fifth Edition Pulsipher For technical support call 1-800-936-6899 GeographyPortal Quick Start for Pulsipher, World Regional

More information

Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java

Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java CS121/IS223 Object Reference Variables Dr Olly Gotel ogotel@pace.edu http://csis.pace.edu/~ogotel Having problems? -- Come see me or call me in my office hours -- Use the CSIS programming tutors Agenda

More information

Announcements. 1. Forms to return today after class:

Announcements. 1. Forms to return today after class: Announcements Handouts (3) to pick up 1. Forms to return today after class: Pretest (take during class later) Laptop information form (fill out during class later) Academic honesty form (must sign) 2.

More information

Problem 1. Remove consecutive duplicates (6 points, 11 mintues)

Problem 1. Remove consecutive duplicates (6 points, 11 mintues) Problem 1. Remove consecutive duplicates (6 points, 11 mintues) CS3 Fall 04 Midterm 2 Consider a function remove-conseq-dups that takes a sentence and returns a sentence in which any occurrences of a word

More information

Lecture 13. Instructor: Craig Duckett. Boolean Expressions, Logical Operators, and Return Values

Lecture 13. Instructor: Craig Duckett. Boolean Expressions, Logical Operators, and Return Values Lecture 13 Instructor: Craig Duckett Boolean Expressions, Logical Operators, and Return Values Assignment 3: The Maze DUE TONIGHT! Uploaded to StudentTracker by midnight If you are submitting as part of

More information

Animations involving numbers

Animations involving numbers 136 Chapter 8 Animations involving numbers 8.1 Model and view The examples of Chapter 6 all compute the next picture in the animation from the previous picture. This turns out to be a rather restrictive

More information

Using GitHub to Share with SparkFun a

Using GitHub to Share with SparkFun a Using GitHub to Share with SparkFun a learn.sparkfun.com tutorial Available online at: http://sfe.io/t52 Contents Introduction Gitting Started Forking a Repository Committing, Pushing and Pulling Syncing

More information

Architectural Engineering Senior Thesis CPEP Webpage Guidelines and Instructions

Architectural Engineering Senior Thesis CPEP Webpage Guidelines and Instructions Architectural Engineering Senior Thesis CPEP Webpage Guidelines and Instructions Your Thesis Drive (T:\) Each student is allocated space on the Thesis drive. Any files on this drive are accessible from

More information

Final Exam. Programming Assignment 3. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings

Final Exam. Programming Assignment 3. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Interfaces vs. Inheritance Abstract Classes Inner Classes Readings This Week: No new readings. Consolidate! (Reminder: Readings

More information

Week 2: Data and Output

Week 2: Data and Output CS 170 Java Programming 1 Week 2: Data and Output Learning to speak Java Types, Values and Variables Output Objects and Methods What s the Plan? Topic I: A little review IPO, hardware, software and Java

More information