Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken.

Slides:



Advertisements
Similar presentations
Topics Introduction Types of Errors Exceptions Exception Handling
Advertisements

Announcements You survived midterm 2! No Class / No Office hours Friday.
Coding and Debugging. Requirements and Specification Recall the four steps of problem solving: Orient, Plan, Execute, Test Before you start the implementation.
Getting to know Greenfoot
Program: Little Crab Mr Gano.
Wombats Creating Games with Greenfoot The Walker School – Games and Simulations
Python Magic Select a Lesson: Why Learn to Code? Basic Python Syntax
This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation. All.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
Conversational Computers
9-Aug-15 Vocabulary. Programming Vocabulary Watch closely, you might even want to take some notes. There’s a short quiz at the end of this presentation!
Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
Microsoft ® Office Word 2007 Training Mail Merge II: Use the Ribbon and perform a complex mail merge [Your company name] presents:
Binary Arithmetic Math For Computers.
Lesson 3 Variables – How our Brains Work - Variables in Python.
Multiplication and Division Addition and Subtraction PracticeExponentsParenthesesHomeQuizIntroduction Objective and Standards Please Excuse My Dear Aunt.
Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012.
CHAPTER 1 XNA Game Studio 4.0. Your First Project A computer game is not just a program—it is also lots of other bits and pieces that make playing the.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Introducing Java.
11 Games and Content Session 4.1. Session Overview  Show how games are made up of program code and content  Find out about the content management system.
Introduction to VB.NET Tonga Institute of Higher Education.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Teach Yourself Windows 98 Module 2: Working with Files, Folders, and the Desktop.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
VIDEO GAME PROGRAMMING Video Game Programming Junior – DigiPutt INSTRUCTOR TEACHER’S ASSISTANT.
Greenfoot. Getting Started Open the Greenfoot download site: Select Greenfoot
/425 Declarative Methods - J. Eisner /425 Declarative Methods Prof. Jason Eisner MWF 3-4pm (sometimes 3-4:15)
Exploring Your Desktop To run presentation, please click on bottom arrow to right to change to next frame.
Task 1 On your own, think of all of the types of film that you get (for example – horror). We call these genres. Write one on your card. When your teacher.
 We are going to learn about programming in general…How to think logically and problem solve. The programming language we will use is Python. This is.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
CSE 113 Introduction to Computer Programming Lecture slides for Week 2 Wednesday, September 7 th, 2011 Instructor: Scott Settembre.
Programming With C.
Bug Session Four. Session description Objectives Session activities summary Resources Prior knowledge of sequencing instructions using Bug Bug website.
Chapter 1 - Getting to know Greenfoot
Arrays Tonga Institute of Higher Education. Introduction An array is a data structure Definitions  Cell/Element – A box in which you can enter a piece.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
Digital Stories Using Microsoft Photo Story 3 for Windows Carrie Roth (248)
Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Basic Program Construction
Greenfoot Game Programming Club.
Alice Learning to program: Part Two Writing Your Own Methods by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
Chapter Three The UNIX Editors.
Introduction to Python Lesson 1 First Program. Learning Outcomes In this lesson the student will: 1.Learn some important facts about PC’s 2.Learn how.
Lesson 1: Writing a program. Java Java is a programming language Computer cannot understand it, though it can be translated ( compiled ) so a computer.
Kakihijau.googlepages.com Introduction To Greenfoot Part-1.
Tutorial for Arrays and Lists. Description This presentation will cover the basics of using Arrays and Lists in an Alice world It uses a set of chickens.
Lesson 2: Reading a program. Remember: from yesterday We learned about… Precise language is needed to program Actors and Classes Methods – step by step.
1 CS 106 Computing Fundamentals II Chapter 211 “Coding And Debugging” Herbert G. Mayer, PSU CS status 6/29/2013 Initial content copied verbatim from CS.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Introduction To Greenfoot
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
1 CA202 Spreadsheet Application Automating Repetitive Tasks with Macros Lecture # 12 Dammam Community College.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
School of Computer Science Space School 2015 Programming a Lunar Lander Game.
Learning to program with Logo
The Little Crab Scenario
Prof. Jason Eisner MWF 3-4pm (sometimes 3-4:15)
Introduction to TouchDevelop
Coding Concepts (Standards and Testing)
15-110: Principles of Computing
Greenfoot November 8, 2009.
Running a Java Program using Blue Jay.
Bishopston Comprehensive School
Presentation transcript:

Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too! Greenfoot Computer programming Lesson 1

Objectives Understand what programming is and its purpose. Develop awareness of basic programming skills and concepts. Create a simple program in Greenfoot. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

What is a program? A program is a step-by-step set of instructions that tells a computer how to do something. A more geeky term is “algorithm” which is a step-by-step description of how to accomplish some task. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

7 key points 1.One of the first differences you have to understand between giving a set of instructions for a person and one for the computer, is that the computer is an empty box that does nothing w/o programs or instructions. 2.A computer has little capacity to interpret things – it has to be told directly. 3.The instructions you give to them have to be very precise. 4.Computers do exactly what you tell them to do, nothing more, nothing less (its not the computers fault you keep dying / losing / crashing, its you!). 5.When you tell a computer to do something you also have to break it down into steps that it can understand. 6.The only steps a computer really understands are steps that are very small and exact. 7.This means that in order to write programs we don’t use English – in this instance we use a language called JAVA. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Why bother to learn to program? Nearly every activity you do in your daily life involves a computer, whether you realize it or not. When you think about computers in your life, you might only think of your desktop or laptop. However, your phone, iPod, and every other electronic gadget you might own these days is really a digital computer. Quick challenge: List on paper how many computers you come across or use in a normal day. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Why bother to learn to program? Learning how to program is a great way for anyone to improve your problem solving capabilities (A bit like when your stuck in a game or trying to plan out the fastest route to somewhere). Most programs solve a type of problem for us. The first step in any programming task is figuring out how to solve the problem yourself in sufficient detail that you can give the instructions to a computer. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Greenfoot Chapter One Scenario After copying the Greenfoot Book Scenarios to your network folder, we will open chapter01/leaves-and-wombats ->double click on the icon for Greenfoot to execute the project. We need to right-click on the Wombat Class to add an object to the world. Your instructor will show you how to add the Wombat to the World. 1.When the program opens click on the COMPILE button. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Greenfoot Chapter One Scenario \ We will go through Chapter One and discuss terms and concepts. We will add a Wombat to our world. We click RUN to make the Wombat move!

The Greenfoot interface The World The Classes Execution controls Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Lets make a simple world 1.Open Greenfoot and choose “create a new scenario”. 2. Name your game and save into your workspace 3. Right click on “world” and choose “new subclass” 4. Choose the background “sand.jpg. Then give it a suitable name. 5. Click on “compile to see your new world. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Now lets add an object. 1.Right click on Actor and choose New subclass. 2. Under animals choose “ant3” and name it “Ant” (at the top!). 3.Click on the Any object. Now HOLD SHIFT and click in your world to place the ant. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Lets move our object. You have noticed if we press RUN nothing happens – that’s because we haven't told our ant to do anything (stupid ant is a computer and can’t think for itself) RIGHT CLICK on the Ant object and choose the “open editor” option. This is where all the fun begins! This is what is known as the code. Lets move onto making our Ant (object move) move. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Adding code Add the following code into your Ant. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Click on compile and place your ant into the world again. Now look what happens when you click run. You can change the speed of the ant by changing the number 4 in the code to a different number. Higher makes it faster, lower makes the ant slower -- see if you can guess what happens with a negative number. Then try it! Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Some points to note when coding You have noticed you must precisely match what is written in the example. Common mistakes include: – capitalising the m – Capitalisation matters in Java! – Missing the semi-colon;;;;;; – using the wrong brackets (more in a second!) – or accidentally deleting the curly brackets. If you get an error look for one of these errors that you might have made when copying the code. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!

Some points on brackets. A quick note about brackets. There are three main bracket types used in Java; let's see some blown-up images of them: Round brackets, known in the USA as parentheses, but in the UK simply as brackets. In Java, they are used in mathematical expressions, and to surround the lists for method calls (we'll get to those shortly). Square brackets, known in the USA simply as brackets (see where confusion can arise?). In Java, they are used for arrays. Curly brackets, also known as braces or squiggly brackets. In Java, these are used to surround blocks of code, such as methods or the contents of classes. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too! () [] {}

Changing the code Now see what happens if you change the code to the following:

Ok – finally lets try this…

Objectives Understand what programming is and its purpose. Develop awareness of basic programming skills and concepts. Create a simple programme in Greenfoot. Created by NW 2012 – please note all copyright on images used is property of copyright holder. Note: some of the more complicated descriptions are taken from so credit to them too!