CSCI 273.002 Processing CSCI 201.003 Introduction to Algorithm

CSCI 273.002 Processing CSCI 201.003 Introduction to Algorithm

CSCI 273.002 Processing CSCI 201.003 Introduction to Algorithm Design An Introduction 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 1

0001 0000 0011 0001 (moving the number from memory location "3" to Register # 1) Instruction 2 0001 0000 0100 0010 (moving the number from memory location "4" to Register # 2) Instruction 3 0011 0001 0010 0011 (Adding Register #1 and Register # 2, and putting the result in Register # 3) Instruction 4 0010 0011 0000 0100 (Moving the contents of Register # 3 in Memory location "4") 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 bytecode the machine language of the Java Virtual Machine (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. The JVM may use JIT (Just-In-Time) compilation to translate bytecode to machine language But were 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 youre 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 Moodle If you are new to Moodle, a new account was created for you and the login instructions, including your password, was emailed to your UNCA email address. If you

forward your UNCA email to an external account, check the Spam/Bulk mail folder of that account for the email. If you have forgotten your password, go to the Moodle login screen and select the Lost Password link. However, presently the Moodle section isnt ready 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. Homework 1

Read pages 1-10 for our next class. If you have a home computer, download and install Processing from Why three Java courses? Traditional CS1 (201.001 & 201.002) Starts with Python Uses drjava as IDE and interactive Java evaluator Uses media computation package Mathematical CS1 (273.001)

How to compute it Use NetBeans as IDE Closest to the traditional CS1` Processing CS1 (201.003 & 273.002) Uses Processing as IDE Uses Processing for multimedia packages Ends with Arduino

Recently Viewed Presentations

  • Ethics and Journalism

    Ethics and Journalism

    Arial ヒラギノ角ゴ Pro W3 Verdana MS Pゴシック Wingdings Poppl-Laudatio BoldCondensed AGaramond Bold Times New Roman Times Arial Arial Columns Ethics and Journalism From Bob Steele at the Poynter Institute PowerPoint Presentation Seven Basic Steps Legal & Ethical Simulation #1 Legal...
  • Name: ___________________________ 4 th Grade List 1: Plural

    Name: ___________________________ 4 th Grade List 1: Plural

    Name: _____ 4th Grade List 1: Plural words with -es Spelling Tic Tac Toe Homework churches radios mosquitoes eyes pushes
  • The staar Expository essay - Denton ISD

    The staar Expository essay - Denton ISD

    Plan your essay: 5 minutes. Choose your strongest example or two strongest examples. DO NOT USE MORE THAN TWO EXAMPLES! Write down as many details as you can about each example. Write down how that example relates to the writing...
  • Map Elements - Arjumand Zaidi

    Map Elements - Arjumand Zaidi

    MAP SCALE Sizing the Model ... soil map Isopleth map (contour or isarithmic): shows a continuous three dimensional surface such as elevation using lines connecting points of equal value (contours). e.g elevation, travel time contours from a point(s), land values,...
  • Texas Public Information Act: An Overview

    Texas Public Information Act: An Overview

    Originally Adopted as the Open Records Act in 1973. Found in Chapter 552 of the Government Code. 34,911 Open Records Letter Rulings issued in fiscal year2019. 688 Open Records Decisions issued since 1973. Chapters 63 and 70 of title 1...
  • Using QT - Kutztown University of Pennsylvania

    Using QT - Kutztown University of Pennsylvania

    Using QT Usually you want to put all the code for a project in a single directory. Our first project will come from QT's tutorial - a GUI metric conversion cd qt mkdir metric cd metric Starting Assistant and Designer...
  • 'Glasgow Sonnets (i)' Edwin Morgan - Mrs Ruxton

    'Glasgow Sonnets (i)' Edwin Morgan - Mrs Ruxton

    It is generally accepted that the original tenements, like the one described in the poem, should have been renovated rather than destroyed. 'Glasgow Sonnet (i)' Edwin Morgan A mean wind wanders through the backcourt trash. Hackles on puddles rise, old...
  • Applying trigonometry

    Applying trigonometry

    If we are given one side and one acute angle in a right-angled triangle, we can use one of the three trigonometric ratios to find the lengths of other sides.