Chapter 1: An Overview of Computers and Programming Languages

Slides:



Advertisements
Similar presentations
Chapter 1 An Overview of Computers and Programming Languages.
Advertisements

ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
Overview of Computers & Programming Languages Chapter 1.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 24, 2005.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
COMP 14 Introduction to Programming
Chapter 1: An Overview of Computers and Programming Languages
1-1 ICS102: Introduction To Computing I King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Topic 1: Introduction to Computers and Programming
Processor Types And Instruction Sets Barak Perelman CS147 Prof. Lee.
CHAPTER 1 AN OVERVIEW OF COMPUTERS AND PROGRAMMING LANGUAGES.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 1 – Introduction to Computers, the Internet, and the Web Outline 1.1 Introduction 1.2 What Is a.
Chapter 1: An Overview of Computers and Programming Languages.
CSE378 Gen. Intro1 Machine Organization and Assembly Language Programming Machine Organization –Hardware-centric view (in this class) –Not at the transistor.
CSC 111 Java Programming I. Java Programming: From Problem Analysis to Program Design, Second Edition  Instructor – Salwa Hamad Al-Jasser  Office.
About the Presentations The presentations cover the objectives found in the opening of each chapter All chapter objectives are listed in the beginning.
Chapter 1 An Overview of Computers and Programming Languages.
EGR 2261 Engineering Problem Solving Using C and C++ Professor Nick Reeder.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 1: An Overview of Computers and Programming Languages.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 1: An Overview of Computers and Programming Languages.
Overview of Programming and Problem Solving. Objectives In this chapter you will: Learn about different types of computers Explore the hardware and software.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 1: An Overview of Computers and Programming Languages.
Introduction to Computer Systems and the Java Programming Language.
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 1: An Overview of Computers and Programming Languages.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, D.S. Malik D.S. Malik.
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 1: An Overview of Computers and Programming Languages.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
1 Chapter 1 Programming Languages Evolution of Programming Languages To run a Java program: Java instructions need to be translated into an intermediate.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
Chapter 1 Introduction. Components of a Computer CPU (central processing unit) Executing instructions –Carrying out arithmetic and logical operations.
C++ Programming: Program Design Including Data Structures, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
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.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Introduction to Programming By: Prof. Muhammad Abu Baker Siddique 2 nd Lecture 1.
Java Programming: Guided Learning with Early Objects Chapter 0 An Overview of Computer and Programming Languages.
Java Programming: From the Ground Up
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1 – Introduction to Computers, the Internet, and the Web
Chapter 1: An Overview of Computers and Programming Languages
Overview of Computers and Programming Chapter 1
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
About the Presentations
Chapter 1: An Overview of Computers and Programming Languages
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
About the Presentations
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Overview of Computers & Programming Languages
Introduction CSC 111.
ICS103 Programming in C 1: Overview of Computers And Programming
Presentation transcript:

Chapter 1: An Overview of Computers and Programming Languages Java Programming: Program Design Including Data Structures

Chapter Objectives Learn about different types of computers Explore the hardware and software components of a computer system Learn about the language of a computer Learn about the evolution of programming languages Examine high-level programming languages Discover what a compiler is and what it does Java Programming: Program Design Including Data Structures

Chapter Objectives (continued) Examine a Java program Examine how a Java program is processed Become aware of the Internet and World Wide Web Learn what an algorithm is and explore problem-solving techniques Become aware of structured and object-oriented programming design methodologies Java Programming: Program Design Including Data Structures

Introduction Computers have greatly affected our daily lives— helping us complete many tasks Computer programs (software) are designed specifically for each task Software is created with programming languages Java is an example of a programming language Java Programming: Program Design Including Data Structures

An Overview of the History of Computers 1950s: Very large devices available to a select few 1960s: Large corporations owned computers 1970s: Computers got smaller and cheaper 1990s: Computers got cheaper and faster and were found in most homes Java Programming: Program Design Including Data Structures

Elements of a Computer System A computer has two components: Hardware Software Java Programming: Program Design Including Data Structures

Hardware Components of a Computer Central processing unit (CPU) Main memory Java Programming: Program Design Including Data Structures

Central Processing Unit Control unit (CU) Arithmetic logic unit (ALU) Program counter (PC) Instruction register (IR) Java Programming: Program Design Including Data Structures

Hardware Components of a Computer Java Programming: Program Design Including Data Structures

Main Memory Ordered sequence of cells (memory cells) Directly connected to CPU All programs must be brought into main memory before execution When power is turned off, everything in main memory is lost Java Programming: Program Design Including Data Structures

Main Memory with 100 Storage Cells Java Programming: Program Design Including Data Structures

Secondary Storage Provides permanent storage for information Examples of secondary storage: Hard disks Floppy disks Zip disks CD-ROMs Tapes Java Programming: Program Design Including Data Structures

Input Devices Devices that feed data and computer programs into computers Examples: Keyboard Mouse Secondary storage Java Programming: Program Design Including Data Structures

Output Devices Devices that the computer uses to display results Examples: Printer Monitor Secondary storage Java Programming: Program Design Including Data Structures

Software Software consists of programs written to perform specific tasks Two types of programs: System programs Application programs Java Programming: Program Design Including Data Structures

System Programs System programs control the computer The operating system is first to load when you turn on a computer Java Programming: Program Design Including Data Structures

Operating System (OS) The OS monitors the overall activity of the computer and provides services Example services: Memory management Input/output Activities Storage management Java Programming: Program Design Including Data Structures

Application Programs Written using programming languages Perform a specific task Run by the OS Example programs: Word processors Spreadsheets Games Java Programming: Program Design Including Data Structures

Language of a Computer Machine language is the most basic language of a computer A sequence of 0s and 1s Every computer directly understands its own machine language A bit is a binary digit, 0 or 1 A byte is a sequence of eight bits Java Programming: Program Design Including Data Structures

Language of a Computer (continued) Java Programming: Program Design Including Data Structures

Evolution of Programming Languages Early computers programmed in machine language Assembly languages were developed to make programmer’s job easier In assembly language, an instruction is an easy-to-remember form called a mnemonic Assembler: Translates assembly language instructions into machine language Java Programming: Program Design Including Data Structures

Instructions in Assembly and Machine Languages Java Programming: Program Design Including Data Structures

Instruction Set Architectures This list is far from comprehensive as old architectures are abandoned and new ones invented on a continual basis. ISAs commonly implemented in hardware * Alpha AXP (DEC Alpha) * ARM (Acorn RISC Machine) (Advanced RISC Machine now ARM Ltd) * Burroughs B5000/B6000/B7000 series * IA-64 (Itanium) * MIPS * Motorola 68k * PA-RISC (HP Precision Architecture) * IBM 700/7000 series * IBM POWER * PDP-11 (Digital Equipment Corporation) * PowerPC * SPARC * SuperH * System/360 * Tricore (Infineon) * Transputer (STMicroelectronics) * UNIVAC 1100/2200 series * VAX (Digital Equipment Corporation) * x86 (also known as IA-32) (Pentium, Athlon) * x86-64 (also known as AMD64 and Intel 64) * EISC (AE32K) ISAs commonly implemented in software with hardware incarnations * p-Code (UCSD p-System Version III on Western Digital Pascal MicroEngine) * Java virtual machine (ARM Jazelle, PicoJava, JOP) * FORTH ISAs never implemented in hardware * ALGOL object code * SECD machine, a virtual machine used for some functional programming languages. * MMIX, a teaching machine used in Donald Knuth's The Art of Computer Programming * Z-machine, a virtual machine used for Infocom's text adventure games Java Programming: Program Design Including Data Structures

Evolution of Programming Languages High-level languages make programming easier Closer to spoken languages Examples: Visual Basic, C#, J# FORTRAN COBOL C/C++ Java Java Programming: Program Design Including Data Structures

Evolution of Programming Languages Java Programming: Program Design Including Data Structures

Evolution of Programming Languages (continued) To run a Java program: Java instructions need to be translated into an intermediate language called bytecode The bytecode is interpreted into a particular machine language Java Programming: Program Design Including Data Structures

Evolution of Programming Languages (continued) Compiler: A program that translates a program written in a high-level language into the equivalent machine language With Java, this machine language is the bytecode Java Virtual Machine (JVM): A hypothetical computer developed to make Java programs machine independent Java Programming: Program Design Including Data Structures

A Java Program public class HolaMundo { /* my first JAVA program */ public static void main(String[] argv) System.out.println("Hola mundo"); } Sample Run: Hola mundo Java Programming: Program Design Including Data Structures

A Java Program HolaMundo - ByteCode Java Programming: Program Design Including Data Structures

A Java Program Java Programming: Program Design Including Data Structures

A Java Program public class ASimpleJavaProgram { public static void main(String[] args) System.out.println("My first Java program"); System.out.println("The sum of 2 and 3 = " + 5); System.out.println("7 + 8 = " + (7 + 8)); } Sample Run: My first Java program The sum of 2 and 3 = 5 7 + 8 = 15 Java Programming: Program Design Including Data Structures

Processing a Java Program Types of Java programs: applications and applets Source program: Written in a high-level language Loader: Transfers the compiled code (bytecode) into main memory Interpreter: Reads and translates each bytecode instruction into machine language and then executes it Java Programming: Program Design Including Data Structures

Processing a Java Program (continued) Java Programming: Program Design Including Data Structures

Problem-Analysis-Coding-Execution Cycle Algorithm: A step-by-step, problem-solving process in which a solution is arrived at in a finite amount of time (steps). Java Programming: Program Design Including Data Structures

Problem-Solving Process Analyze the problem: Outline solution requirements and design an algorithm Implement the algorithm in a programming language (Java) and verify that the algorithm works Maintain the program: Use and modify if the problem domain changes Java Programming: Program Design Including Data Structures

Problem-Analysis-Coding-Execution Cycle Java Programming: Program Design Including Data Structures

Programming Methodologies Two basic approaches to programming design: Structured design Object-oriented design Java Programming: Program Design Including Data Structures

Structured Design A problem is divided into smaller sub-problems Each sub-problem is solved The solutions of all sub-problems are combined to solve the problem Java Programming: Program Design Including Data Structures

Object-Oriented Design (OOD) OOD: program is a collection of interacting objects An object consists of data and operations Steps in OOD: Identify objects Form the basis of the solution Determine how these objects interact Java Programming: Program Design Including Data Structures

Chapter Summary A computer system is made up of hardware and software components Computers understand machine language; it is easiest for programmers to write in high-level languages A compiler translates high-level language into machine language The Java steps required to execute a program are edit, compile, load, and execute Java Programming: Program Design Including Data Structures

Chapter Summary (continued) Algorithm: step-by-step, problem-solving process. Solution is arrived at in a finite amount of time The three steps of the problem-solving process Analyze the problem and design an algorithm Implement the algorithm in a programming language Maintain the program Two approaches to programming design are structured design and object-oriented design Java Programming: Program Design Including Data Structures