Computer Programming 12 Mr. Jean March 19 th, 2013.

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

Chapter 2 First Java Programs
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Chapter 1 Introduction to JAVA. Why Learn JAVA? Java is one of the fastest growing programming language in the world. Java is one of the fastest growing.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
1 Fall 2008ACS-1903 Chapter 1 Topics Java History Java Programs Why Program? Computer Systems: Hardware and Software Programming Languages What Is a Program.
Introduction to Computer Programming CSC 1401: Introduction to Programming with Java Lecture 2 Wanda M. Kunkle.
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 Programming with Java, for Beginners Machine vs. Programming Language Intro to Java Edit-Compile-Run Program Process.
Chapter 3 Software Two major types of software
Course: Introduction to Computers
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
LESSON 1 INTRODUCTION Compiled By: Edwin O. Okech [Tutor, Amoud University] JAVA PROGRAMMING.
CMSC 202 Computer Science II for Majors Fall 2009 Introduction.
Computer Software.
Types of software. Sonam Dema..
Chapter 2 First Java Programs
Operating System.
1 CSC 551: Web Programming Spring 2004 Java Overview  Design goals & features  platform independence, portable, secure, simple, object-oriented, … 
Computer Programming 12 Mr. Jean March 3 rd, 2014.
1.1 History of Computers 1940s: The ENIAC was one of the world’s first computers. Large stand-alone machine Used large amounts of electricity Contained.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
Lesson 2: First Java Programs
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Java Workshop for Teachers May 6, 2005 A Brief Look at the Java Programming Language.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
1 Chapter 2 First Java Programs Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Introduction to Interactive Media Interactive Media Tools: Software.
Software Writer:-Rashedul Hasan Editor:- Jasim Uddin.
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 Computing Fundamantals With thanks to Laudon & Laudon Session 2.
1.8History of Java Java –Based on C and C++ –Originally developed in early 1991 for intelligent consumer electronic devices Market did not develop, project.
Lesson 2: First Java Programs. Objectives: –Discuss why Java is an important programming language. –Explain the Java virtual machine and byte code. –Choose.
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.
POS 406 Java Technology And Beginning Java Code
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
Chapter 3: Computer Software. Stored Program Concept v The concept of preparing a precise list of exactly what the computer is to do (this list is called.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Systems Software Operating Systems. What is software? Software is the term that we use for all the programs and data that we use with a computer system.
Lecture 3 January 14, 2002 CSC Programming I Fall 2001.
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 35 – Overview of Java Web Programming Webpage:
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
10/8: Software What is software? –Types of software System software: Operating systems Applications Creating software –Evolution of software development.
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and web applications Very rich GUI libraries Portability (machine independence) A real Object.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Java How to Program, 9/e Presented by: José M. Reyes Álamo © by Pearson Education, Inc. All Rights Reserved.
การเขียนโปรแกรมภาษา จาวา Java Programming อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 1.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
Chapter 2 First Java Programs Fundamentals of Java.
1 Sections Java Virtual Machine and Byte Code Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Lesson 2: First Java Programs. 2.1 Why Java? Java is one of the most popular programming languages in the world. Java is a modern object-oriented programming.
2.5 Edit, Compile, and Execute Figure 2-3 illustrates the edit, compile and execute steps. Java bytecode.
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.
Chapter 5 Operating Systems.
Text by: Lambert and Osborne
Chapter 2 First Java Programs
(Computer fundamental Lab)
Road to Object Oriented Programming
Presentation transcript:

Computer Programming 12 Mr. Jean March 19 th, 2013

The plan: Video clip of the day Why Java More simple programs

2.1 Why Java? Java is the fastest growing programming language in the world. Java is a modern object-oriented programming language. Java has benefited by learning from the less desirable features of early object-oriented programming languages.

2.1 Why Java? Java is ideally suited to develop distributed, network-based applications because it: –Enables the construction of virus-free, tamper-free systems (security) –Supports the development of programs that do not overwrite memory (robust) –Yields programs that can be run on different types of computers without change (portable)

2.1 Why Java? Java supports advanced programming concepts such as threads. –A thread is a process that can run concurrently with other processes. Java resembles C++, the world’s most popular industrial strength programming language. Java however, runs more slowly than most modern programming languages because it is interpreted.

2.2 The Java Virtual Machine and Byte Code Java compilers translate Java into pseudomachine language called java byte code. To run java byte code on a particular computer, a Java virtual machine (JVM) must be installed.

2.2 The Java Virtual Machine and Byte Code A Java virtual machine is a program that acts like a computer. It is called an interpreter. Disadvantage: –Runs more slowly than an actual computer To combat slower processing, some JVMs translate code when first encountered. This is known as just-in-time compilation (JIT).

2.2 The Java Virtual Machine and Byte Code Advantages: –Portability. Any computer can run Java byte code. –Applets. Applets are small Java programs already translated into byte code. Applets run in a JVM incorporated in a web browser Applets can be decorative (like animated characters on a web page.) Applets can be practical (like continuous streams of stock market quotes.) –Security. It is possible to limit the capabilities of a Java program since it runs inside a virtual machine.

2.3 Choosing a User Interface Style There are two types of user interfaces available to use to create Java programs. –Graphical User Interface (GUI) –Terminal I/O interface Figure 2-1 illustrates both interfaces used to create the same program.

2.3 Choosing a User Interface Style

There are 3 reasons for beginning with terminal I/O: –It is easier to implement than a GUI –There are programming situations that require terminal I/O –Terminal-oriented programs are similar in structure to programs that process files of sequentially organized data. (What is learned here is easily transferred to that setting.)

2.4 Hello World Figure 2-2 displays the results of a small Java program, entitled “hello world”

2.4 Hello World A program is a sequence of instructions for a computer. The following is the bulk of instructions, or source code, for the “hello world” program.

2.4 Hello World Sending messages to objects always takes the following form:. ( )

2.4 Hello World The original “hello world” program needs to be embedded in a larger framework defined by several additional lines of code, in order to be a valid program.

2.5 Edit, Compile, and Execute Figure 2-3 illustrates the edit, compile and execute steps.

2.5 Edit, Compile, and Execute Development environments: –Unix standard text editor command line activation of compiler and JVM –DOS, using Microsoft Windows and NT OS notepad text editor command line activation of compiler and JVM from a DOS window –Integrated development environment, using Windows, NT, or MAC OS Examples: Symantec’s Visual Café, Microsoft’s Visual J++, or Borland’s J Builder

2.5 Edit, Compile, and Execute Preparing your development environment: –Create a directory, open a terminal window, use the cd command to move to your new directory –Open notepad, create the file HelloWorld.java, type in the lines of code –Save the file, go back to the terminal window, compile the program –Run the program

2.5 Edit, Compile, and Execute The following figures illustrate the steps necessary for preparing your development environment.

2.5 Edit, Compile, and Execute

Today’s Task: Create a program which completes the following task. Output Display needed: a = 30 b = 40 a * b = 1200

Today’s Task: Build Program #2 Build Program #3 Using what we have seen in programs #2 & #3, build a program which successfully asks for your name, what class your are in and today’s date.