Chapter 1: Introduction to Computers and Programming

Similar documents
Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

Chapter 1: Why Program? Computers and Programming. Why Program?

Chapter 1 Introduction to Computers and Programming

Introduction. Arizona State University 1

CHAPTER 1: INTRODUCTION TO COMPUTERS AND PROGRAMMING. 1 Muhalim Mohamed Amin Faculty of

Week 0: Intro to Computers and Programming. 1.1 Why Program? 1.2 Computer Systems: Hardware and Software. Hardware Components

SCSP Programming Technique C

BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1

CHAPTER 1 Introduction to Computers and Java

C H A P T E R 1. Introduction to Computers and Programming

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017

Chapter 1 INTRODUCTION

Programming 1 - Honors

Chapter 1: An Overview of Computers and Programming Languages. Objectives. Objectives (cont d.) Introduction

Chapter 1. Introduction to Programming and Visual Basic Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of

CS1500 Algorithms and Data Structures for Engineering, FALL Virgil Pavlu, Jose Annunziato,

1a Computers, Problem Solving!

Computer Basics 1/24/13. Computer Organization. Computer systems consist of hardware and software.

Introduction to Java Programming

1.The First Instrument known in the history of computers was. a) Pascal s adding machine b) Napier s bones c) Abacus d) Analytical Engine

An Overview of the Computer System. Kafui A. Prebbie 24

The Programming Process Summer 2010 Margaret Reid-Miller

Parts of the Computer System. Parts of the Computer System. Parts of the Computer System. Essential Computer Hardware. Information Processing Cycle

CSI31 Introduction to Computer Programming I. Dr. Sharon Persinger Fall

Computer Basics 1/6/16. Computer Organization. Computer systems consist of hardware and software.

Computer Organization

C++ Programming Language Lecture 1 Introduction

Fundamentals of Programming Session 1

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Why Learn to Program?

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

HARDWARE. There are a number of factors that effect the speed of the processor. Explain how these factors affect the speed of the computer s CPU.

AN INTRODUCTION TO THE COMPUTER

Chapter 1. Introduction to Computers and Programming. M hiwa ahmad aziz

Fundamentals of Programming Session 1

Information Science 1

Problem Solving and Program Design - Chapter 1. Cory L. Strope

Fundamentals of Programming. Lecture 1: Introduction to C Programming

Computer Fundamentals

Agenda Computer Hardware Input Devices Output Devices Secondary Storage Computer Software System Software Application Software Working with Windows

Fundamentals of Programming (Python) Basic Concepts. Ali Taheri Sharif University of Technology Spring 2018

Welcome to Computer Organization and Design Logic

National 5 Computing Science Software Design & Development

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

Ch. 1: Computer System part I

Chapter 1 Introduction to Computers and C++ Programming

Pharmacy college.. Assist.Prof. Dr. Abdullah A. Abdullah

Question Bank. Fundamentals Of Computer FYBCA (SEM - I)

Chapter 1 Computer and Programming. By Zerihun Alemayehu

Introduction to Computers and Java

Welcome to Computer Organization and Design Logic CS 64: Computer Organization and Design Logic Lecture #1 Winter 2018

Review for COSC 120 8/31/2017. Review for COSC 120 Computer Systems. Review for COSC 120 Computer Structure

Introduction to Computers. Joslyn A. Smith

Q1. Describe C.P.U and its subunits with the help of diagram?

COMPUTER BASICS Processing/Storage

An Introduction to Computers and Java CSC 121 Spring 2015 Howard Rosenthal

Downloaded From :

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing

What is the typical configuration of a computer sold today? 1-1

An Introduc+on to Computers and Java CSC 121 Spring 2017 Howard Rosenthal

Basic Computer Programming for ISNE. Santi Phithakkitnukoon ผศ.ดร.ส นต พ ท กษ ก จน ก ร

Electricity: Voltage. Gate: A signal enters the gate at a certain voltage. The gate performs operations on it, and sends it out was a new signal.

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

LECTURE SCHEDULE 2. Units of Memory, Hardware, Software and Classification of Computers

CSCE150A. Administrivia. Overview. Hardware. Software. Example. Program. Pseudocode. Flowchart. Control Structures. Hello World Program CSCE150A

Computer Science & Engineering 150A Problem Solving Using Computers

Total Mark out of 35

EKT 120/4 Computer Programming KOLEJ UNIVERSITI KEJURUTERAAN UTARA MALAYSIA

Programming Principles and Techniques

Chapter One. Introduction to Computer System

Computer is an electronic machine that can receive, store, transform and output data of all kinds (image, text, numeric, graphics and sound).

Computer Hardware. Java Software Solutions Lewis & Loftus. Key Hardware Components 12/17/2013

Name: Date: Hour: The abacus (still in use today) is about 5,000 years old. Not a computer.

Computers Are Your Future

A Review of Chapter 5 and. CSc 2010 Spring 2012 Instructor: Qian Hu

ST. MARY S COLLEGE FORM 4

Chapter 1 Introduction to Computers and C++ Programming

Main Parts of Personal Computer

Java and Software Design

8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics

machine cycle, the CPU: (a) Fetches an instruction, (b) Decodes the instruction, (c) Executes the instruction, and (d) Stores the result.

COMPUTER SYSTEM. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U

Programming: detailed instructions which tell the computer hardware what to do aka software Computer Science: the study NOT of computers, but of what

INFORMATION COMUNICATION TECHNOLOGY SKS Lecture Two

Computer Architecture and Assembly Language. Spring

Sahalsoftware college. Welcome To understanding Basic Computer Concept

Introduction to Computers and Java

0 Introduction: Computer systems and program development

15/09/15. Introduction to Computers & The Internet. Contents. Computer hardware and software. Input and output devices CPU. Memory.

Computer Organization

Programming 1. Lecture 1 COP 3014 Fall August 28, 2018

1.1 Bits and Bit Patterns. Boolean Operations. Figure 2.1 CPU and main memory connected via a bus. CS11102 Introduction to Computer Science

Computer System Overview

Computer ANAMIKA ACADEMY. Mo Which function has the ability to move from one web page to another Hyper link

Scientific Computing

ET156 Introduction to C Programming

Computer Principles and Components 1

CS 241 Computer Programming. Introduction. Teacher Assistant. Hadeel Al-Ateeq

Transcription:

Chapter 1: Introduction to Computers and Programming

1.1 Why Program?

Why Program? Computer programmable machine designed to follow instructions Program instructions in computer memory to make it do something Programmer person who writes instructions (programs) to make computer perform a task SO, without programmers, no programs; without programs, a computer cannot do anything

1.2 Computer Systems: Hardware and Software

Main Hardware Component Categories: 1. Central Processing Unit (CPU) 2. Main Memory ( aka RAM ) 3. Secondary Memory / Storage 4. Input Devices 5. Output Devices

Main Hardware Component Categories Figure 1-2

Central Processing Unit (CPU) Comprised of: Control Unit ( CU ) Retrieves and decodes program instructions Coordinates activities of all other parts of computer Arithmetic & Logic Unit ( ALU ) Hardware optimized for high-speed numeric calculation Hardware designed for true/false, yes/no decisions

CPU Organization Figure 1-3

Main Memory It is volatile. Main memory is erased when a program terminates or computer is turned off Also called Random Access Memory (RAM) Organized as follows: bit: smallest piece of memory. Has values 0 (off, false) or 1 (on, true) byte: 8 consecutive bits. Bytes have addresses.

Main Memory Address Each byte in memory is identified by a unique number known as an address.

Main Memory In Figure 1-4, the number 149 is stored in the byte with the address 16, and the number 72 is stored at address 23.

Secondary Storage Non-volatile: data retained when program is not running or computer is turned off Comes in a variety of media: magnetic: floppy disk, hard drive optical: CD-ROM, DVD Flash drives, connected to the USB port

Input Devices Devices that send information to the computer from outside Many devices can provide input: Keyboard, mouse, scanner, digital camera, microphone Disk drives, CD drives, and DVD drives

Software-Programs That Run on a Computer Categories of software: System software: programs that manage the computer hardware and the programs that run on them. Examples: operating systems, utility programs, software development tools Application software: programs that provide services to the user. Examples: word processing, games, programs to solve specific problems

1.3 Programs and Programming Languages

Programs and Programming Languages A program is a set of instructions that the computer follows to perform a task We start with an algorithm, which is a set of well-defined steps.

Example Algorithm for Calculating Gross Pay

Machine Language Although the previous algorithm defines the steps for calculating the gross pay, it is not ready to be executed on the computer. The computer only executes machine language instructions

Machine Language Machine language instructions are binary numbers, such as 1011010000000101 Rather than writing programs in machine language, programmers use programming languages.

Programs and Programming Languages Types of languages: Low-level: used for communication with computer hardware directly. Often written in binary machine code (0 s/1 s) directly. High-level: closer to human language

Some Well-Known Programming Languages (Table 1-1 on Page 10) BASIC FORTRAN COBOL C C# C++ Ruby Java Visual Basic JavaScript Python

From a High-Level Program to an Executable File a) Create file containing the program with a text editor. b) Run preprocessor to convert source file directives to source code program statements. c) Run compiler to convert source program into machine instructions. d) Run linker to connect hardware-specific code to machine instructions, producing an executable file. Steps b d are often performed by a single command or button click. Errors detected at any step will prevent execution of following steps.

From a High-Level Program to an Executable File

Integrated Development Environments (IDEs) An integrated development environment, or IDE, combines all the tools needed to write, compile, and debug a program into a single software application. Examples are Microsoft Visual C++, Turbo C++ Explorer, Eclipse, NetBeans, jgrasp,codewarrior, etc.

Integrated Development Environments (IDEs)

1.4 What is a Program Made of?

What is a Program Made of? Common elements in programming languages: Key Words Programmer-Defined Identifiers Operators Punctuation Syntax

Program 1-1

Key Words Also known as reserved words Have a special meaning in C++ Can not be used for any other purpose Key words in the Program 1-1: using, namespace, int, double, and return

Key Words

Programmer-Defined Identifiers Names made up by the programmer Not part of the C++ language Used to represent various things: variables (memory locations), functions, etc. In Program 1-1: hours, rate, and pay.

Operators Used to perform operations on data Many types of operators: Arithmetic: + - * / % Assignment: = Some operators in Program1-1: << >> = *

Operators

Punctuation Characters that mark the end of a statement, or that separate items in a list In Program 1-1:, and ;

Punctuation

Syntax The rules of grammar that must be followed when writing a program Controls the use of key words, operators, programmer-defined symbols, and punctuation

Variables A variable is a named storage location in the computer s memory for holding a piece of data. In Program 1-1 we used three variables: The hours variable was used to hold the hours worked The rate variable was used to hold the pay rate The pay variable was used to hold the gross pay

Variable Definitions To create a variable in a program you must write a variable definition (also called a variable declaration) Here is the statement from Program 1-1 that defines the variables: double hours, rate, pay;

Variable Definitions There are many different types of data, which you will learn about in this course. A variable holds a specific type of data. The variable definition specifies the type of data a variable can hold, and the variable name.

Variable Definitions Once again, line 7 from Program 1-1: double hours, rate, pay; The word double specifies that the variables can hold double-precision floating-point numbers. (You will learn more about that in Chapter 2)

1.5 Input, Processing, and Output

Input, Processing, and Output Three steps that a program typically performs: 1) Gather input data: from keyboard from files on disk drives 2) Process the input data 3) Display the results as output: send it to the screen write to a file

1.6 The Programming Process

The Programming Process

1.7 Procedural and Object-Oriented Programming

Procedural and Object-Oriented Programming Procedural programming: focus is on the process. Procedures/functions are written to process data. Object-Oriented programming: focus is on objects, which contain data and the means to manipulate the data. Messages are sent to objects to perform operations.