IB Computer Science II Paul Bui

Slides:



Advertisements
Similar presentations
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
Advertisements

Object Oriented Programming in Java George Mason University Fall 2011
Chapter 2: Your First Program! Hello World: Let’s Program  All programs must have the extension.java  Our first program will be named: HelloWorld.java.
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.
CHAPTER 1 INTRODUCTION GOALS  To understand the activity of programming  To learn about the architecture of computers  To learn about machine code and.
Introduction to Java Programming
1 Programming Languages b Each type of CPU has its own specific machine language b But, writing programs in machine languages is cumbersome (too detailed)
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,
Slide 1 of 40. Lecture A The Java Programming Language Invented 1995 by James Gosling at Sun Microsystems. Based on previous languages: C, C++, Objective-C,
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
Introduction to Java.
Using the Java programming language compiler. Review of relevant material from previous lectures From previous lectures: A computer can only execute machine.
IB Computer Science II Paul Bui
Introduction to Java Tonga Institute of Higher Education.
CSCI 273: Processing An Introduction. Programming Languages –An abstract "human understandable" language for telling the computer what to do –The abstract.
Basics Programming Concepts. Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language.
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.
Introduction to Computers and Java Chapter 1.3. A Sip of Java: Outline History of the Java Language Applets A First Java Program Compiling a Java Program.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
FRST JAVA PROGRAM. Getting Started with Java Programming A Simple Java Application Compiling Programs Executing Applications.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Java and C# [this is a bonus – it is not a required lesson] ACO101: Introduction to Computer Science.
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.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Compiling and the Java Virtual Machine (JVM). The syntax of Pseudocode is pretty loose –visual validation encourages a permissive approach –emphasized.
2-1 Hardware CPU Memory - 2 kinds Network Graphics Input and Output Devices.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Software for Translators Barcelona, January 2002.
Fall 2006Slides adapted from Java Concepts companion slides1 Introduction Advanced Programming ICOM 4015 Lecture 1 Reading: Java Concepts Chapter 1.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
4-Nov-15 Air Force Institute of Technology Electrical and Computer Engineering Object-Oriented Programming Design Topic 1: The Java Environment Maj Joel.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
A Look at Java. Categorize Java Which paradigm? Which paradigm? Scripting? Scripting? Declarative or procedural? Declarative or procedural? Which generation?
CS101: Introduction to Computer Science Slides adapted from Sedgewick and Wayne Copyright © Your First Java.
Java Basics 1 Brief History of Java and Overview of Langauge.
Chapter 1 Introduction. Chapter Goals To understand the activity of programming To learn about the architecture of computers To learn about machine code.
© 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
CHAPTER 1 INTRODUCTION. CHAPTER GOALS To understand the activity of programming To learn about the architecture of computers To learn about machine code.
CSCI 212 Object-Oriented Programming in Java. Prerequisite: CSCI 111 variable assignment statement while loop for loop post-increment (i++) strong typing.
3/5/2002e-business and Information Systems1 Java Java Java Virtual Machine (JVM) Java Application Program Interface (API) HW Kernel API Application Programs.
CS 177 Recitation Week 1 – Intro to Java. Questions?
ITP 109 Week 2 Trina Gregory Introduction to Java.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Introduction to java (class and object). Programming languages: –Easier to understand than CPU instructions –Needs to be translated for the CPU to understand.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Introduction to Computer Science What is Computer Science? Getting Started Programming.
CS-140 Dick Steflik Lecture 3. Java C++ Interpreted optimized for the internet Runs on virtual ized machine Derived from C++ Good object model Widely.
Introduction of Java Fikri Fadlillah, S.T.
CS210 Intermediate Computing with Data Structures (Java)
Lecture 1b- Introduction
John Woodward A Simple Program – Hello world
Computational Thinking, Problem-solving and Programming: General Principals IB Computer Science.
GC101 Introduction to computer and program
Programming without BlueJ Week 12
Java programming lecture one
CompSci 230 Software Construction
Introduction to Java Dept. Business Computing University of Winnipeg
TRANSLATORS AND IDEs Key Revision Points.
Getting Started ARCS Lab..
Introduction to Algorithm Design
Introduction CSC 111.
Java Intro.
Run Java file with Window cmd
Programming Languages
Review of Previous Lesson
Programming language translators
Presentation transcript:

IB Computer Science II Paul Bui Introduction to Java IB Computer Science II Paul Bui

What does a computer look like? Central Processing Unit (CPU) Memory

What is a computer program? 101011110101010100110010000011101011010111101010101001100100000111010101111010101010011001000001110101011110101010100110010000011101010111101010101001100100000111010101111010101010011001000001110101011110101010100110010000011101010111101010101001100100010010000011101010111101010

Assembly Language Also known as machine code/language or low-level language Example: ADD R1, R2, R3 SUB R1, R1, 1 MULT R3, R1, R2 Why can’t I run my PC programs on a Mac?!?!? Different from machine to machine

I Hate Tedious Stuff Old school programs Invention of the high-level language ADD R1, R2, R3 SUB R1, R1, 1  D = B*(B+C-1) MULT R4, R1, R2 Waaaay easier to understand

Compilers Translates or converts a high-level language (e.g., Java, C++) to a low-level language Does other stuff too! Checks syntax Optimizations and more! One would say, “Yeah, so I compiled my code to an executable or binary”

Before Java… Applications or Programs Operating System (Windows XP, Mac OSX, etc.) Hardware (CPU + Memory + etc.)

How Java Works Java Application or Java Program Java Runtime Environment or Java Virtual Machine Operating System (Windows XP, Mac OSX, etc.) Hardware (CPU + Memory + etc.)

What does this mean? Java bytecode (Java’s low-level language) Java sourcecode (high-level)  Java bytecode (low-level)  assembly Two different operating systems with the JRE or JVM can run the same Java program

Ok, so I want to program now! //My first Java program! class HelloWorld{ public static void main(String[] args) { System.out.println("Hello World!"); }

How to Compile and Execute Open a text editor (gedit, tea, vi, etc.) Code Code Code Save file as CLASSNAME.java Example: HelloWorld.java Open a terminal javac HelloWorld.java java HelloWorld