The University of Akron Summit College

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
1 Fall 2008ACS-1903 Chapter 1 Topics Java History Java Programs Why Program? Computer Systems: Hardware and Software Programming Languages What Is a Program.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Computers: Tools for an Information Age
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Introduction to Computers and Programming
CS102 Introduction to Computer Programming
Computer Programming-1 CSC 111 Chapter 1 : Introduction.
Tools make jobs easier to do -A computer is a tool used by many professions A computer can do many different jobs because they are programmable - Machine.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
© 2012 Pearson Education, Inc. All rights reserved. Starting Out with Java: From Control Structures through Data Structures Second Edition by Tony Gaddis.
Introduction to Java Lecture # Java History Green Team started by Sun Microsystems. *7 Handheld controller for multiple entertainment systems.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Chapter 1 Introduction to Computer and Java 1. Contents 1.Introduction 2.Why Program? 3.Computer Systems: Hardware and Software 4.Programming Languages.
CISC105 General Computer Science Class 1 – 6/5/2006.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
Chapter 1: Introduction to Computers and Java
Introduction to Computer Systems and the Java Programming Language.
© 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 Programming, Second Edition Chapter One Creating Your First Java Program.
CHAPTER 1 Introduction to Computers and Java Copyright © 2016 Pearson Education, Inc., Hoboken NJ.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Java: From Control Structures through Objects Third Edition.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
© 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.
Chapter 1: Introduction to Computers and Java 1-2 Chapter Topics Chapter 1 discusses the following main topics: –Introduction –Why Program? –Computer.
Chapter 1 An Overview of Computers and Programming Languages.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
CHAPTER 1 Introduction to Computers and Java Copyright © 2016 Pearson Education, Ltd.
© 2012 Pearson Education, Inc. All rights reserved. Starting Out with Java: From Control Structures through Data Structures Second Edition by Tony Gaddis.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Chapter 1: Introduction to Computers and Programming
Chapter 1 Introduction 2nd Semester H
Java Programming: From the Ground Up
BASIC PROGRAMMING C SCP1103 (02)
Chapter 1 – Introduction to Computers, the Internet, and the Web
Topics Introduction Hardware and Software How Computers Store Data
CSCI-235 Micro-Computer Applications
Lecture 1: Introduction to JAVA
BASIC PROGRAMMING C SCP1103 (02)
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: Introduction to Computers and Java
Java programming lecture one
C++ Programming: From Problem Analysis to Program Design
Chapter 1: Introduction to Computers and Programming
Topics Introduction Hardware and Software How Computers Store Data
ICS103 Programming in C 1: Overview of Computers And Programming
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

The University of Akron Summit College 2440: 160 Java Programming Introduction to Computers & Java Professor: Enoch E. Damson

Parts of an Information System Hardware Software Procedures Data People Introduction to Computers & Java

Introduction to Computers & Java Hardware Physical components of a computer Consists of: Input devices Processor or Central Processing Unit (CPU) Main memory Secondary storage devices Output devices Introduction to Computers & Java

Introduction to Computers & Java Input Devices Collects data for the computer Common devices include: Keyboard Mouse Scanner Digital camera Introduction to Computers & Java

Central Processing Unit (CPU) Fetches instructions, follow the instructions, and produce some resulting data Measured in terms of its speed in hertz (MHz, GHz) Consists of two parts: Control Unit – coordinates all of the computer’s operations Arithmetic & Logic Unit (ALU) – performs mathematical operations Introduction to Computers & Java

Introduction to Computers & Java Main Memory Commonly known as the random-access memory (RAM) Measured in terms of its size in bytes (KB, MB, GB) RAM is usually a volatile type of memory for temporary storage Divided into sections (bytes) that hold equal amount of data Each byte is made up of 8 binary digits (bits) that use 0 and 1 to represents on and off “switches” Each byte is a assigned a unique number known as an address, which are ordered from lowest to highest Introduction to Computers & Java

Secondary Storage Devices Type of memory that hold data for long periods of time Measured in terms of their size in bytes (KB, MB, GB) Common types of secondary storage devices include: Hard disks Jump drives Zip disks Floppy disks Introduction to Computers & Java

Introduction to Computers & Java Output Devices Formats and presents processed data (information) to the outside world Common devices include: Monitors Printers Introduction to Computers & Java

Introduction to Computers & Java Software Programs that run on a computer Has two general categories: System software – enables application software to interact with the computer hardware E.g. operating systems, utilities, device drivers, and programming languages Application software – programs that solve specific problems or perform general operations useful to the user E.g. word processors, spreadsheets, etc Introduction to Computers & Java

Introduction to Computers & Java Procedures Rules or guidelines for people to follow when using software, hardware, and data Guidelines are documented in manuals Introduction to Computers & Java

Introduction to Computers & Java Data Raw facts entered into the computer system for processing Processed to produce information Introduction to Computers & Java

Introduction to Computers & Java People Making people more productive is what computers are all about Users include: Analysts Designers Developers End-users Introduction to Computers & Java

Introduction to Computers & Java Computer Program Set of instructions that enables the computer to solve a problem or perform a task The instructions are called algorithms A computer’s CPU can only process algorithms written in machine language – consisting of binary numbers (0s and 1s) E.g. 1011010000000101 Each different type of CPU has its own machine language Algorithms written with programming languages are much easier to understand Introduction to Computers & Java

Introduction to Computers & Java Computer Programming An art and a science of creating instructions to solve problems and perform tasks An art because every aspect of the program should be carefully designed A science because of the need to indulge in the tasks of analyzing, experimenting, correcting, and redesigning Introduction to Computers & Java

Program Development (Programming) Cycle The process of writing instructions (programs) for a computer to solve a problem Programming steps include: Creating program specifications Designing the application Writing source code Compiling/Interpreting programs Executing (running) program Introduction to Computers & Java

Program Development (Programming) Cycle… Creating program specifications – the requirements the application must meet Introduction to Computers & Java

Program Development (Programming) Cycle… Designing the application – create file formats, screen layouts, and algorithms Algorithm – a sequence of procedures, programming code, or commands that are used as part of a program or result in a program Tools used in designing the sequential and logical structure of a program include: Flowchart – uses symbols for program design Pseudocode – uses natural English for program design Introduction to Computers & Java

Program Development (Programming) Cycle… Writing source code – the code must be written, tested and debugged Source code (file) – the file with the actual code which is written with a programming language of choice in a text editor Debugging – the process of going through program code to locate and fix errors such as: Syntax errors – grammatical mistakes in program language use Logical errors – logical mistakes in a program Introduction to Computers & Java

Program Development (Programming) Cycle… Compiling/Interpreting programs – the source code is translated in its entirety at one time (compiled) or a single line at a time (interpreted) from high-level program instructions into machine language, and executed if no errors are found (run) Introduction to Computers & Java

Program Development (Programming) Cycle… Compiling/Interpreting programs Compiler – a system software program that translates an entire high-level program (source code) at one time into machine language (object code grouped together in files called library files) that the computer can interpret and execute It gives no feedback until the entire program has been compiled Interpreter – a system software program that translates a single line at a time in a program An immediate feedback is given if the code contains an error Introduction to Computers & Java

Program Development (Programming) Cycle… Executing (running) program – the compiled or interpreted code is executed if no errors are found Executable code – a linker or link editor resolves object code references to other programs by creating an executable code. Introduction to Computers & Java

Programming Languages Invented to ease the task of programming with the use of words instead of binary numbers Programming languages have evolved in generations and are improved over the years The generations of programming languages include: Low-level languages High-level languages Introduction to Computers & Java

Programming Languages… Low-level languages – include: Machine language (1st Generation) – instructions are coded as a series of 0s and 1s and are unique to a particular computer Assembler language (2nd Generation) – instructions are coded using some recognized symbols called mnemonics (memory aids) and are also unique to a particular computer Example: MUL is used to represent a multiply instruction. An assembler translates the mnemonics into 0s and 1s Introduction to Computers & Java

Programming Languages… High-level languages – programs instructions are often written in English-like expressions in languages such as: 3rd Generation languages – instructions are coded at the programmer’s convenience but cannot be executed in their original form (source code) A compiler or interpreter is needed to translate the language syntax into low-level machine language to be executed. Examples include: FORTRAN (FORmula TRANslator)-1955, Pascal-1968, C-1972, C++-1980s, Java-1990 4th Generation languages – Has a graphical user interface (GUI) that combines a code editor, compiler, debugger, linker, and executor into a single Inter-Development Environment (IDE). Examples include: Visual Basic, Delphi, PowerBuilder, Visual.NET, etc Introduction to Computers & Java

Programming Language Elements Every programming language uses the following general program elements: Syntax – rules of a programming language Comments – non executing programming language statements Constant data – raw data used in programming such as numbers, strings, etc Data output – displaying data on a screen or sending data to a file Data input – receiving data from the keyboard or file Variables – named memory locations for data storage Introduction to Computers & Java

Programming Language Elements… Other programming language elements include: Data types – specifies the types of data native to the programming language Keywords – words with a special meaning in the programming language Operators – symbols or words that perform operations on operands Selections (Condition testing) Repetitions (Looping structures) Arrays Files/Databases Introduction to Computers & Java

Methods of Programming Two primary methods of programming are: Procedural – creates programs made up of variables and procedures Variable – named storage location in a computer’s memory Procedure – set of programming language statements that perform a specific task Object-oriented – creates programs made up of objects (instances of a class) Object – a software entity with attributes (fields) and procedures (methods) Class – specifies the attributes and methods of objects Introduction to Computers & Java

Principles of Object-Oriented Programming (OOP) Encapsulation – grouping data (fields, methods, etc) into a single object Information Hiding (Abstraction) – hiding an object’s data from other objects The object’s methods are used directly access its data Typically, the object’s data is hidden but allows its methods to be accessed Inheritance – deriving classes (subclasses) based on other existing classes (superclasses) Polymorphism - using the same procedure name or operator with different types of arguments There are 2 types of polymorphism: overloading and overriding Introduction to Computers & Java

Introduction to Computers & Java History of Java In 1991 the Green Team was formed at Sun Microsystems to develop a hand-held device (named *7) to control home entertainment devices James Gosling (the project leader) created the Oak language for the project The Oak language translated programs into byte code for different processors Oak (renamed Java) was later used to develop a Web browser named HotJava – which was able to download and run small Java programs known as applets HotJava was demonstrated in 1995 which made Java popular Netscape later incorporated Java into its Navigator browser Introduction to Computers & Java

Introduction to Computers & Java Types of Java Programs Two types of Java programs are: Application – stand-alone programs that run on a computer Applets – programs that are transmitted over the Internet from a Web server and executed on a Web browser Introduction to Computers & Java

Introduction to Computers & Java Properties of Java Object-Oriented – uses objects to perform specific tasks Portable – enables programs to behave identical on different platforms like: Mac, Windows, Solaris (UNIX) Compiles into byte code instead of machine language – the byte code is read by the Java Virtual Machine (JVM) – which interprets the code for different processors “Architecture-neutral” – the byte code that comes out of the compiler will run on any processor and operating system Can be embedded on Web pages – applets are downloaded and ran from Web pages Secured – Web browsers run applets in a secure environment within a computer’s memory Introduction to Computers & Java

The Java Compiler & Java Virtual Machine (JVM) Text editors are used to write Java programming statements (source code) and saved in a source file (.java extension) and translated (compiled) by a compiler Compiler – program that translates source code into an executable form Java compilers translate source code into a file (.class extension) containing byte code The byte code instructions (not machine language) are executed by the Java Virtual Machine (JVM) The JVM simulates a computer whose machine language is the Java byte code Introduction to Computers & Java

Java Program Development Process The programmer uses a text edit to create a Java source code file (.java extension) The programmer runs the compiler to translate the source code file into a byte code file (.class extension) The Java Virtual Machine (JVM) reads and executes each byte code instruction Text Editor Source File Java Compiler Byte Code File Java Virtual Machine Introduction to Computers & Java

Introduction to Computers & Java Java Editions The software used to create Java programs is known as the Java Development Kit (JDK) or the Software Development Kit (SDK) Some Java editions include: Java Standard Edition (Java SE) – used for writing Java applications and applets Java Enterprise Edition (Java EE) – used to create business client/server and Web server-based applications Java Micro Edition (Java ME) – runtime-environment for consumer products like cell phones, pagers, etc Introduction to Computers & Java

Java Integrated Development Environments (IDE) Consists of text editor, compiler, debugger, and other utilities integrated into a package Current popular Java IDEs include: Eclipse (http://www.eclipse.org) NetBeans (http://www.netbeans.org) IntelliJ IDEA (http://www.jetbrains.com/idea) jGRASP (http://www.jgrasp.org) Introduction to Computers & Java

Compiling & Running Java Programs javac is used to compile Java programs E.g. javac Hello.java A .class file is created if no are found java is used to run Java programs E.g. java Hello Two types of errors (bugs) are: Syntax errors – mistakes that violate the rules of the programming language Logical errors – mistakes that cause programs to produce erroneous results Introduction to Computers & Java