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.

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
Object Oriented Programming in Java George Mason University Fall 2011
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
Chapter 1: Introduction
Programming Creating programs that run on your PC
Object Orientated Programming
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
Introduction to Computer Programming CSC 1401: Introduction to Programming with Java Lecture 2 Wanda M. Kunkle.
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.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
ICS 102 Computer Programming University of Hail College of Computer Science & Engineering Computer Science and Software Engineering Department.
Introduction to Java.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Java PAL.  Contains the development kit and the runtime environment ( aka the Java Virtual Machine )  Download Link:
Computer Programming-1 CSC 111 Chapter 1 : Introduction.
1 Chapter-01 Introduction to Computers and C++ Programming.
Introduction to Java Tonga Institute of Higher Education.
Lecture 1 Introduction to Java MIT- AITI 2004 What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word.
High-level Languages.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Lecture 1 Introduction to Java MIT-AITI Ethiopia 2004.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
1 Computer Systems -- Introduction  Chapter 1 focuses on:  the structure of a Java application  basic program elements  preparing and executing a program.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Introduction to C++ Programming Language
POS 406 Java Technology And Beginning Java Code
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Week 1 - Friday.  What did we talk about last time?  Our first Java program.
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
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.
Lecture.1: Getting Started With Java Jiang (Jen) ZHENG May 9 th, 2005.
CT1513 Introduction To java © A.AlOsaimi.
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.
Lecture 1. Introduction to Programming and Java MIT- AITI 2003.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
CSE:141 Introduction to Programming Faculty of Computer Science, IBA BS-I (Spring 2010) Lecture 2.
1 Chapter 1 Programming Languages Evolution of Programming Languages To run a Java program: Java instructions need to be translated into an intermediate.
Introduction Mehdi Einali Advanced Programming in Java 1.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
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.
Chapter 1 An Overview of Computers and Programming Languages.
Chapter 1: Introduction to Computers and Programming.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Software Engineering Algorithms, Compilers, & Lifecycle.
Chapter 1Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 1 l Background information »important regardless of programming.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
CS210 Intermediate Computing with Data Structures (Java)
Programming Language Hierarchy, Phases of a Java Program
CSCI-235 Micro-Computer Applications
Lecture 1: Introduction to JAVA
Topic: Difference b/w JDK, JRE, JIT, JVM
Introduction to Computers and Java
Introduction to Java Dept. Business Computing University of Winnipeg
Introduction CSC 111.
(Computer fundamental Lab)
Presentation transcript:

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 problem or opportunity.  Breaking the problem into manageable pieces (decomposing).  Designing a solution.  Considering alternatives to the solution and refining the solution.  Implementing the solution.  Testing the solution and fixing the problems.

What is a program? A program is computer coding that: Takes input Performs some calculation on the input Displays output

What is a program? A program is… –A collection of statements –Written in a programming language –A specification of the steps taken to solve a problem Programs have grammar rules –Specify how the statements are formed –How the statements are combined

Writing programs You need: –Knowledge of a coding language –Problem solving skills –Familiarity with analysis and design process –Software development tools

Programming Language Hierarchy

The highs and lows of programming languages... High-Level Language (HLL) –closest to natural language –words, numbers, and math symbols –not directly understood by hardware –“portable” source code (hardware independent) –Java, C, C++, COBOL, FORTRAN, BASIC, Lisp, Ada, etc. Machine Language (lowest level) –least natural language for humans, most natural language for hardware –just 0s and 1s –directly understood by hardware –not portable (hardware dependent) In order for a program to run on a computer, it must be in that computer’s machine language. Each type of CPU has it’s own language.

Getting from Source to Machine Code “Compiling a program” translating from a high-level language source code to machine (object, or executable) code. “Compiler” a program that translates HLL source code to machine (object, or executable) code. “Assembly” translating from assemble language source code to machine (object, or executable) code. “Assembler” a program that translates assembly source code to machine (object, or executable) code. Compilers need to know the specific target hardware

Compilers vs. Assemblers vs. Interpreters Compilers and Assemblers –translation is a separate user step –translation is “off-line,” i.e. not at run time Interpreters - another way to translate source to object code –interpretation (from source to object code) is not a separate user step –translation is “on-line,” i.e. at run time Source Code

Java Program Translation Both Compilation and Interpretation Intermediate Code: “Byte Code” –portable low-level code –similar to assembly code, but hardware independent –invisible to Java programmer Interpreter translates from generic byte code to hardware-specific machine code Java Program Data for Java Program Java Compiler Byte-Code Program Byte-Code Interpreter Machine-Language Instructions Computer Execution of Machine-Language Instructions Output of Java Program Java Virtual Machine

1 Basic Program Development errors Edit and save program Compile program Execute program and evaluate results

The Java Software Development Kit (SDK) Can be downloaded free from Sun website. a development environment for building applications, applets, and components using the Java programming language These tools are designed to be used from the command line. Except for the appletviewer, these tools do not provide a G raphical U ser I nterface

Java Java was released in 1995 by Sun Microsystems. It is written in the language C++. Java is platform-independent, object-oriented, and easy to use on the Internet.

STOP

A closer look at Java SDK and JCreator IDE.

Java™ SDK, Standard Edition a development environment for building applications, applets, and components using the Java programming language includes tools useful for developing and testing programs written in the Java programming language and running on the Java platform Except for the appletviewer, these tools do not provide a graphical user interface

API Specification Application Programming Interface (API) documentation online and downloadable Contains detailed documentation on all classes and packages in the java standard library java API Specification

The Java Virtual Machine (JVM) – key to portability is an abstract (virtual) computer that runs compiled Java programs –virtual" because it is generally implemented in software on top of a "real" hardware platform and operating system Makes java code portable code compiled on any platform will run on any other platform having Java Virtual Machine

For Home Computer Download and Install JCreator LE JSDK Java API documentation All from jcreator.com/download.htm jcreator.com/download.htm

Organizing Work The H drive is your personal workspace in the classroom. Create folders to organize work by topic, week, semester …

Your first Java Program Start Jcreator Follow instructions to create a Java program named HelloWorld public class HelloWorld { public static void main(String[] args) { }

Your first Java Program public class HelloWorld { public static void main(String[] args) { System.out.println(“Hello World”); }

Creation of a.class file - bytecode Go back to your project directory and look at the new files: –HelloWorld.java – source code –HelloWorld.class - bytecode

On Your Own Open HelloWorld source code and add more output lines. Open java program named Basics –Compile, execute, modify, compile …