CSCI 273.001 Processing CSCI 201.003 Introduction to Algorithm Design An Introduction.

Slides:



Advertisements
Similar presentations
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Advertisements

Object Oriented Programming in Java George Mason University Fall 2011
JAVA BASICS SYNTAX, ERRORS, AND DEBUGGING. OBJECTIVES FOR THIS UNIT Upon completion of this unit, you should be able to: Explain the Java virtual machine.
How do we make our Welcome.java program do something? The java in our Welcome.java file won’t do anything by itself. We need to tell the computer to execute.
How to Create a Java program CS115 Fall George Koutsogiannakis.
How do we make our HelloTester.java program do something? The java in our HelloTester.java file won’t do anything by itself. We need to tell the computer.
IAT 800 Foundations of Computational Art and Design ______________________________________________________________________________________ SCHOOL OF INTERACTIVE.
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
CENG 161 Introduction to Computer Science Instructor: Dr. Nurdan SARAN Lab Assistant: Arzu Burçak Sönmez.
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
Lesson One: The Beginning
Introduction to Java.
Chapter 1 - Introduction. Ch 1Goals To understand the activity of programming To learn about the architecture of computers To learn about machine code.
Editing Java programs with the BlueJ IDE. Working environments to develop (= write) programs There are 2 ways to develop (write) computer programs: 1.Using.
IB Computer Science II Paul Bui
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 18: 0xCAFEBABE (Java Byte Codes)
Introduction to Java Tonga Institute of Higher Education.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
CSC 8505 Compiler Construction IR Example: Java Bytecode (looking inside class files)
Java Programming Robert Chatley William Lee
LCC 6310 Computation as an Expressive Medium Lecture 1.
CSCI 273: Processing An Introduction. Programming Languages –An abstract "human understandable" language for telling the computer what to do –The abstract.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
 Java Programming Environment  Creating Simple Java Application  Lexical Issues  Java Class Library.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
©Xiaoying Gao, Peter Andreae First Java Program COMP 102 #2 2014T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Java Bytecode What is a.class file anyway? Dan Fleck George Mason University Fall 2007.
Introduction to Programming Peggy Batchelor.
©2000, John Wiley & Sons, Inc. Horstmann/Java Essentials, 2/e Chapter 1: Introduction 1 Chapter 1 Introduction.
First Java Program COMP 102 #2 2015T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
CSC204 – Programming I Lecture 4 August 28, 2002.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
1 CSC204 – Programming I Lecture 2 Intro to OOP with Java.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Programming Concept Chapter I Introduction to Java Programming.
Week 1 - Friday.  What did we talk about last time?  Our first Java program.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Fall 2006Slides adapted from Java Concepts companion slides1 Introduction Advanced Programming ICOM 4015 Lecture 1 Reading: Java Concepts Chapter 1.
Comments in Java. When you create a New Project in NetBeans, you'll notice that some text is greyed out, with lots of slashes and asterisks:
CS Software Studio Java Lab 1 Meng-Ting Wang PLLAB, Computer Science Department, National Tsing-Hua University.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Java FilesOops - Mistake Java lingoSyntax
First Programs Chapter 2 The Java language (compiler) on CD ROM Create a program using an editor Compile the program Run the program Integrated Development.
Java.
CHAPTER 1 INTRODUCTION. CHAPTER GOALS To understand the activity of programming To learn about the architecture of computers To learn about machine code.
1/10/2008. >>> About Us Paul Beck * Third quarter TA * Computer Engineering * Ryan Tucker * Second quarter TA * Computer.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
CS 177 Recitation Week 1 – Intro to Java. Questions?
ITP 109 Week 2 Trina Gregory Introduction to Java.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Development Environment
Before You Begin Nahla Abuel-ola /WIT.
GC101 Introduction to computer and program
CS216: Program and Data Representation
LCC 6310 Computation as an Expressive Medium
Introduction to Java Dept. Business Computing University of Winnipeg
How to Run a Java Program
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
Introduction to Algorithm Design
Java Intro.
IB Computer Science II Paul Bui
Computer Programming-1 CSC 111
Review of Previous Lesson
Presentation transcript:

CSCI Processing CSCI Introduction to Algorithm Design An Introduction

Why three Java courses? “Traditional” CS1 ( & ) –Starts with Python –Uses drjava as IDE and interactive Java evaluatordrjava –Uses “media computation” package Mathematical CS1 ( ) –How to compute it –Use NetBeans as IDENetBeans –Closest to the traditional CS1` Processing CS1 ( & ) –Uses Processing as IDE –Uses Processing for multimedia packages –Ends with ArduinoArduino

Programming Languages –An abstract "human understandable" language for telling the computer what to do –The abstract language must be translated into the low level language understood by the machine

Programming Languages –How does a computer work? –The translation from a text source to machine code is accomplished by an interpreter or compiler –How does a compiler work? –How does an interpreter work? Instruction (moving the number from memory location "3" to Register # 1) Instruction (moving the number from memory location "4" to Register # 2) Instruction (Adding Register #1 and Register # 2, and putting the result in Register # 3) Instruction (Moving the contents of Register # 3 in Memory location "4")

Compiler

A Simple Java Program /* this is a simple Java program */ class Example { public static void main(String args[]) { System.out.println("this is a simple Java program"); } Human Readable??

Java VM assembly code (bytecode) Bytecode is interpreted by machine-specific Java Virtual Machines (JVMs). Bytecode consists of simple, step-by-step instructions for the JVM. public static void main(java.lang.String[]); Code: 0: iconst_0 1: istore_1 2: goto 30 5: getstatic 8: new 11: dup 12: ldc 14: invokespecial #23 17: iload_1 18: invokevirtual #27 21: invokevirtual #31 …

How Java Works 1.Source code is first written in plain text files ending with the.java extension. 2.Those source files are then compiled into.class files by the javac compiler. A.class file does not contain code that is native to your processor; it instead contains bytecodes — the machine language of the Java Virtual Machine1 (Java VM). 3.The java launcher tool then runs your application with an instance of the Java Virtual Machine.

Java Virtual Machine Java VM is available on many different operating systems. The same.class files are capable of running on Microsoft Windows, the Solaris TM Operating System (Solaris OS), Linux, or Mac OS.

But we’re using Processing Processing is built on top of Java Supports script-like coding –Easy to get simple programs up fast –But allows transition to full Java programming Has built-in methods and classes to make drawing easy Easy to export program to applet

Processing Environment Menu Toolbar (run, stop, new, open, save, export) Tabs Text editor (this is where you type code) Message area (feedback, errors) Text output (print commands)

Drawing in Processing Automatic creation of display window Window has a coordinate system for drawing

Let's draw a point: point() point(x, y) – draws a point at the location x, y Try it in Processing: point(50, 50) Unexpected token: null – what the !?! Compiler errors appear in the bottom pane All lines must be terminated with a semicolon ; Try drawing several points

Comments Comments are non-program text you put in the file to describe to others (and yourself) what you’re doing Important for being able to look back at your code and understand it –Single-line comments begin with // –Multi-line comments begin with /* and end with */ Commenting and un-commenting lines useful for figuring out code

MoodleMoodle If you are new to Moodle, a new account was created for you and the login instructions, including your password, was ed to your UNCA address. If you forward your UNCA to an external account, check the Spam/Bulk mail folder of that account for the . If you have forgotten your password, go to the Moodle login screen and select the Lost Password link.

Lab 1 Lab 1: Draw a 200 x 300 white canvas. Add 5 points and 5 lines. Revise the 5 points and 5 lines into a composition.