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.

Slides:



Advertisements
Similar presentations
In Review JAVA C++ GUIs - Windows Webopedia.com.
Advertisements

L1:CSC © Dr. Basheer M. Nasef Lecture #1 By Dr. Basheer M. Nasef.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
Chapter 10 Application Development. Chapter Goals Describe the application development process and the role of methodologies, models and tools Compare.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Systems Software Operating Systems.
Computer for Health Sciences
Lecture 1 An Introduction to Computer, Programming and Java 1.
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.
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
Chapter Lead Black Slide Powered by DeSiaMore Powered by DeSiaMore.
CS413: Java Programming language Applications Applets
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
High-level Languages.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
How Java Programs Work MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation ©Akhilesh.
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.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Computers,
CPCS  Problem Solving in Everyday Life  Types of Problems  Problem Solving with Computers  Difficulties with Problem Solving 0-3.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Programs,
Why Java? A brief introduction to Java and its features Prepared by Mithat Konar.
Computer Programming 12 Mr. Jean March 19 th, 2013.
Chapter 1 Introduction to Java 10/8/2015 Lecture 1 1.
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.
Visual BASIC 1 Introduction
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Chapter 1: Introduction to Programs, and Java 1. Objectives To review programs (§ ). To understand the relationship between Java and the World Wide.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Programs.
An Introduction to Software Development Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006.
Lead Black Slide. © 2001 Business & Information Systems 2/e2 Chapter 5 Information System Software.
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
Liang, Introduction to C++ Programming, (c) Chapter 1 Introduction to Computers, Programs, and C++
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
10/8: Software What is software? –Types of software System software: Operating systems Applications Creating software –Evolution of software development.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Spring 2013 Lecture 1: Introduction.
© 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.
ITP 109 Week 2 Trina Gregory Introduction to Java.
An Introduction to Software Development JavaMethods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria Litvin,
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Computers,
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Applications Active Web Documents Active Web Documents.
Chapter 1 Introduction to Computers, Programs, and C++
Chapter 1 Introduction to Computers, Programs, and C++
CSCI-235 Micro-Computer Applications
Chapter 1 Introduction to Computers, Programs, and Java
Text by: Lambert and Osborne
Java programming lecture one
Chapter 4 Computer Software.
Chapter 1 Introduction to Computers, Programs, and Java
CS105 Introduction to Computer Concepts Intro to programming
and Program Development
CSC 142 Introduction to Java [Reading: chapters 1 & 2]
1.3.7 High- and low-level languages and their translators
Programming language translators
CS105 Introduction to Computer Concepts Intro to programming
Presentation transcript:

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 to do so. A program is a set of instructions written by humans for computers to perform tasks. The instructions are written in programming languages such as C, C++, Java, etc.

Programming Languages Machine Language Assembly Language High-Level Language Machine language is a set of primitive instructions built into every computer. The instructions are in the form of binary code, so you have to enter binary codes for various instructions. Program with native machine language is a tedious process. Moreover the programs are highly difficult to read and modify. For example, to add two numbers, you might write an instruction in binary like this:

Programming Languages Machine Language Assembly Language High-Level Language Assembly languages were developed to make programming easy. Since the computer cannot understand assembly language, however, a program called assembler is used to convert assembly language programs into machine code. For example, to add two numbers, you might write an instruction in assembly code like this: ADDF3 R1, R2, R3

Programming Languages Machine Language Assembly Language High-Level Language The high-level languages are English-like and easy to learn and program. For example, the following is a high-level language statement that computes the area of a circle with radius 5: area = 5 * 5 * ;

Popular High-Level Languages COBOL (COmmon Business Oriented Language) FORTRAN (FORmula TRANslation) BASIC (Beginner All-purpose Symbolic Instructional Code) Pascal (named for Blaise Pascal) Ada (named for Ada Lovelace) C (whose developer designed B first) Visual Basic (Basic-like visual language developed by Microsoft) Delphi (Pascal-like visual language developed by Borland) C++ (an object-oriented language, based on C) Java (We use it in this class)

Compiling Programs Computers do not understand the languages (C++, Java, etc) that programs are written in. Programs must first be compiled (converted) into machine code that the computer can run. A compiler is a program that translates a programming language into machine code.

Running Programs All programs follow a simple format: Input Execution Output Inputs can be from users, files, or other computer programs Outputs can take on many forms: numbers, text, graphics, sound, or commands to other programs

Multiple Compilers Because different operating systems (Windows, Macs, Unix) require different machine code, you must compile most programming languages separately for each platform. program compiler Win MAC Unix

Java is a little different. Java compiler produces bytecode not machine code. Bytecode can be run on any computer with the Java interpreter installed. Java Program compiler Java Bytecode Win MAC Unix Interpreter Java Interpreter

Advantages and Disadvantages of Java Advantages: Java is platform independent. Once it's compiled, you can run the bytecode on any machine with a Java interpreter. You do not have to recompile for each platform. Java is safe. Certain common programming bugs and dangerous operations are prevented by the language and compiler. Java standardizes many useful operations like managing network connections and providing graphical user interfaces. Disadvantages: Running bytecode through the interpreter is not as fast as running machine code, which is specific to that platform. Because it is platform independent, it is difficult to use platform specific features (e.g., Windows taskbar, quick launch) in Java. Java interpreter must be installed on the computer in order to run Java programs.

Javas Compiler + Interpreter Editor Hello.java Compiler Hello.class Interpreter Hello, World ! Interpreter

Java Virtual Machine Must Run on Any Architecture Program in Java Java Compiler Java Bytecode Java Virtual Machine WRITE ONCE, RUN ANYWHERE! pretty portable

Why Bytecodes? Platform-independent Load from the Internet faster than source code Interpreter is faster and smaller than it would be for Java source Source code is not revealed to end users Interpreter performs additional security checks, screens out malicious code

Types of Programs Console applications GUI applications Applets

Java on the Web: Java Applets Clients download applets via Web browser Browser runs applet in a Java Virtual Machine (JVM) Interactive web, security, and client consistency Slow to download, inconsistent VMs (besides, flash won this war) Applet Client Server

Java on the Web: J2EE Thin clients (minimize download) Java all server side Client Server JSPsServletsEJBJDBC

Console Applications C:\javamethods\Ch02> path=%PATH%;C:\Program Files\Java\jdk 1.5.0_07\bin C:\javamethods\Ch02> javac Greetings2.java C:\javamethods\Ch02> java Greetings2 Enter your first name: Josephine Enter your last name: Jaworski Hello, Josephine Jaworski Press any key to continue... Simple text dialog: prompt input, prompt input... result

GUI Applications Menus Buttons Clickable panel Slider

OOP Object-Oriented Programming An OOP program models a world of active objects. An object may have its own memory, which may contain other objects. An object has a set of methods that can process messages of certain types.

OOP (contd) A method can change the objects state, send messages to other objects, and create new objects. An object belongs to a particular class, and the functionality of each object is determined by its class. A programmer creates an OOP application by defining classes.

Inheritance A programmer can define hierarchies of classes More general classes are closer to the top Person ChildAdult BabyToddlerTeen

OOP Benefits Facilitates team development Easier to reuse software components and write reusable software Easier GUI (Graphical User Interface) and multimedia programming