Intro to Java & Processing. Review CS is about problem-solving CS is about problem-solving To write programs you must To write programs you must –Be able.

Slides:



Advertisements
Similar presentations
First of all – lets look at the windows you are going to use. At the top you have a toolbar, with all your various tools you can use when customising your.
Advertisements

Microsoft® Word 2010 Training
Code Elements and Processing Coordinate System. Code elements: pages Comments: are documentation notes that are ignored by the computer but are.
A Quick Introduction to Processing
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
Programming What is a program? –A set of instructions –Understood by a computer.
Programming Fundamentals (750113) Ch1. Problem Solving
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
Introduction To C++ Programming 1.0 Basic C++ Program Structure 2.0 Program Control 3.0 Array And Structures 4.0 Function 5.0 Pointer 6.0 Secure Programming.
Binary “There are 10 types of people in the world… those that understand binary and those that don’t.”
C++ Crash Course Class 1 What is programming?. What’s this course about? Goal: Be able to design, write and run simple programs in C++ on a UNIX machine.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
PROCESSING. * Java SDK * downloads/jdk7-downloads html
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
Intro to Java Programming  A computer follows the instruction precisely and exactly.  Anything has to be declared and defined before it can be used.
Tell the robot exactly how to draw a square on the board.
Introduction to VB.NET Tonga Institute of Higher Education.
Chapter 1: Creating Java Programs
Chapter 1.4 Programming languages Homework Due: Monday, August 11, 2014.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
Computing Science 1P Lecture 21: Friday 20 th April Simon Gay Department of Computing Science University of Glasgow 2006/07.
CS 122 Engineering Computation Lab Lab 2 Dan De Sousa and Tim Cheeseman Department of Computer Science Drexel University April 2009 ©By the author. All.
Lesson 6. GCSE Computing – programming languages Candidates should be able to:  describe common tools and facilities available in an integrated development.
Program Development Life Cycle (PDLC)
Board Activity Find your seat on the seating chart Login – Remember your login is your first initial your last name and the last three numbers of your.
Microsoft Word Objective: Understand Basic Word/Word Processing Skills Lesson: Create and Save a New Document LOL: Understand/Apply Create your first Word.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/6/08.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
A guide to creating a power point display Essentials Ctl M =New Slide: a new slide can be inserted. It is placed after the slide that you are viewing.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
C++ and Ubuntu Linux Review and Practice CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and.
Setting up Cygwin Computer Organization I 1 May 2010 ©2010 McQuain Cygwin: getting the setup tool Free, almost complete UNIX environment emulation.
Intro to CS ACO 101 Lab Rat. Academic Integrity What does that mean in programming? Log into Blackboard and take the test titled “Applied Computing Course.
Microsoft ® Word 2010 Training Create your first Word document I.
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.
A-1 © 2000 UW CSE University of Washington Computer Programming I Lecture 21: Course Wrap-up and Look Ahead.
CSC 120CPVL – Introduction to Creative Graphical Coding, Fall 2015 August, week 1, 2015 Dr. Dale Parson.
1 Project designed and created by M. Shajith Kumar.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Introduction to Eclipse Programming with an Integrated Development Environment.
11 Computers, C#, XNA, and You Session 1.1. Session Overview  Find out what computers are all about ...and what makes a great programmer  Discover.
Chapter 4-1: Measures of Angles as Rotations. Review… Angle: The union of two rays which are its sides with the same vertex or endpoint. Angle: The rotation.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Introduction to Computer Programming - Project 1 Intro to Digital Technology.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
ITP 109 Week 2 Trina Gregory Introduction to Java.
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
Please open JCreator and follow these steps: 1)Configure  Options 2)JDK Tools 3)Choose Run Applet from drop-down 4)Click Default, then Edit 5)Click the.
Programming for Interactivity Professor Bill Tomlinson Tuesday & Wednesday 6:00-7:50pm Fall 2005.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
CompSci 4 Java 4 Apr 14, 2009 Prof. Susan Rodger.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Unit Testing.
Scratch for Interactivity
Eclipse Navigation & Usage.
Introduction to Computer Programming
Programming.
CS 240 – Advanced Programming Concepts
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Presentation transcript:

Intro to Java & Processing

Review CS is about problem-solving CS is about problem-solving To write programs you must To write programs you must –Be able to solve the problem yourself –Be able to describe the solution to another –Be able to describe the solution to the computer (programming)

Programming Programs: how to tell a computer what to do Programs: how to tell a computer what to do –Each line is a command to the computer –The computer is stupid, so you have to type everything in exactly –If you make a mistake, you get an error and have to fix it In this class, we use a programming language called Java In this class, we use a programming language called Java –Java is called an Object-Oriented language

About Programming Java is Case-SENsITivE! Java is Case-SENsITivE! Punctuation matters Punctuation matters Spelling matters Spelling matters File names matter File names matter Spaces don’t matter much Spaces don’t matter much Be careful! Be careful! Follow the examples… Follow the examples…

The tool… IDE: Integrated Development Environment IDE: Integrated Development Environment A Program that does it all together, and it’s PRETTY… A Program that does it all together, and it’s PRETTY… One IDE is Eclipse One IDE is Eclipse

Fun with Graphics We use a Java library called Processing that makes graphics easy. We use a Java library called Processing that makes graphics easy. Just open a new Processing project and check out the src folder. Just open a new Processing project and check out the src folder. Pixels! Pixels! –Color (RGB, 0-255, Additive model, think LIGHT!) –x,y value

Computer Graphics

How it works 2 sections: setup & draw 2 sections: setup & draw Setup: stuff that happens when the window opens (once) Setup: stuff that happens when the window opens (once) Draw: stuff that happens many times a second Draw: stuff that happens many times a second

Processing commands background(255,0,0); background(255,0,0); size(800,450); size(800,450);

Shapes triangle(Ax,Ay,Bx,By,Cx,Cy); triangle(Ax,Ay,Bx,By,Cx,Cy); rect(ULx, ULy, w, h); rect(ULx, ULy, w, h); ellipse(Cx,Cy,w,h); ellipse(Cx,Cy,w,h); What’s the difference in putting these in setup() vs draw()? Try it. What’s the difference in putting these in setup() vs draw()? Try it. What’s the difference between drawing a rectangle then a triangle or the triangle then a rectangle? Try it. What’s the difference between drawing a rectangle then a triangle or the triangle then a rectangle? Try it.

Circles & Arcs Angles done in radians & clockwise Angles done in radians & clockwise You must put the smaller number before the larger number. Add TWO_PI if you need to to get a bigger number. You must put the smaller number before the larger number. Add TWO_PI if you need to to get a bigger number.

Shape Attributes fill(R,G,B); fill(R,G,B); stroke(R,G,B); stroke(R,G,B); noFill(); noFill(); noStroke(); noStroke(); strokeWeight(n); strokeWeight(n);

Comments Don’t do too much without comments! Don’t do too much without comments! // - one line comment // - one line comment /* /* –paragraph */

ERROR!! Sometimes it just doesn’t work… Sometimes it just doesn’t work… Types of errors: Types of errors: –Compiler error No semicolon No semicolon public Class Program{ public Class Program{ –Logic error answer = 2+3; answer = 2+3; “The anser is “ “The anser is “ –Fatal or Runtime error answer = 2/0; answer = 2/0;

And then what? Fix the program, save it, recompile, re- execute until everything works Fix the program, save it, recompile, re- execute until everything works The error is often called a “bug” The error is often called a “bug” Fixing it is called debugging Fixing it is called debugging

There’s lots more… You get a cheat sheet and the API! You get a cheat sheet and the API!

PW0 Make a face Make a face Turn it in Turn it in