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

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

Chapter 1: Introduction to Computers and Programming

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

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

Chapter 1 Introduction to Computers and Programming

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

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

Introduction. Arizona State University 1

SCSP Programming Technique C

Chapter 1 INTRODUCTION

EKT 120/4 Computer Programming KOLEJ UNIVERSITI KEJURUTERAAN UTARA MALAYSIA

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

Computer Fundamentals

1a Computers, Problem Solving!

Programming 1 - Honors

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

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

Chapter 1 Introduction to Computers and C++ Programming

CHAPTER 1 Introduction to Computers and Java

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

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

Lecture 1: Preliminaries

CSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York

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

CSC180: Lecture 2. Wael Aboulsaadat.

Fundamentals of Programming. Lecture 1: Introduction to C Programming

C++ Programming Language Lecture 1 Introduction

Introduction to Java Programming

SECTION 2 (Part B) Types And Components Of Computer Systems. Sophia Pratzioti

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

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

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

Week 1 Introduction to Computer and Algorithm (Part1) UniMAP Sem II 11/12 DKT121: Basic Computer Programming 1

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

0 Introduction: Computer systems and program development

Chapter One. Introduction to Computer System

Computer Principles and Components 1

8/25/2016. What Is a Computer? The Components of a Computer

Information Communications Technology (CE-ICT) 6 th Class

Lecture 1: CS2400 Introduction to Computer Science

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

Hardware and Software - Revision Summary

Ch. 1: Computer System part I

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

COMPUTER BASICS LECTURER: ATHENA TOUMBOURI

Java and Software Design

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

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

elc International School

Welcome to Computer Organization and Design Logic

Zimmer CSCI /24/18. CHAPTER 1 Overview. COMPUTER Programmable devices that can store, retrieve, and process data.

Lecture 01 & 02 Computer Programming

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

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

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

ST. MARY S COLLEGE FORM 4

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

Introduction to Computers. Joslyn A. Smith

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

COMP163. Introduction to Computer Programming. Introduction and Overview of the Hardware

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

Computer Science & Engineering 150A Problem Solving Using Computers

Types of Data. PE 231 Education Media AND Technology. Information. Assessment. Information Concepts

Chapter 1 Introduction to Computers and C++ Programming

The Programming Process Summer 2010 Margaret Reid-Miller

INFORMATION COMUNICATION TECHNOLOGY SKS Lecture Two

INFORMATION SYSTEM PARTS AND COMPUTER TYPES

Test Bank for Prelude to Programming Chapter 0

Programming Principles and Techniques

True/False Indicate whether the statement is true or false. Bubble A for True and B for False

True/False Indicate whether the statement is true or false. Bubble A for True and B for False

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

Total Mark out of 35

Computer Devices Part 1 25 Question(s) Test ID:

COMPUTER HARDWARE RAYMOND ROSE

Computer Organization

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

Outline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples

Computer System Overview

Computer Components 1 CSC1103- Nouf AlJaffan Saturday, 02 February 2013

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

Angel International School - Manipay 1 st Term Examination November, 2015 ICT

Computers in Engineering COMP 208. Computer Structure. Computer Architecture. Computer Structure Michael A. Hawker

Fundamentals of Programming (C)

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

Introduction to Computers and Java

Module 1: Introduction

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

Introducing the Computer

Chapter 2: Computers: The Machines Behind Computing.

ENT 189: COMPUTER PROGRAMMING. H/P: Home page:

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.

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java

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

CHAPTER 1 TYPES & COMPONENTS OF COMPUTER SYSTEM

There are many types of computers, including:

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

Introduction to Computers and Java

Transcription:

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

Learning Outcomes At the end of this lecture, you should be able to: tell the purpose of computer programs. describe the hardware and software components of a computer system. tell about the language of a computer. describe the evolution of programming languages. list high-level programming languages. LECTURE 1 2

Learning Outcomes (cont.) At the end of this lecture, you should be able to: tell about the history of C++ language. recognize a C++ program. explain how a C++ program is processed and tested. explain what compiler, linker and loader are and what they do. explain the different types of program errors. recognize the Professional Ethics for Computer Programmers. LECTURE 1 3

Why Program? Computer programmable machine designed to follow instructions. Program a set of instructions for a computer to follow. Programmer person who writes instructions (program) to make computer perform a task. SO, without programmers, no program; without program, a computer cannot do anything. LECTURE 1 4

Computer Components Computer is an electronic device, with two major components. Computer Hardware Software LECTURE 1 5

Computer Hardware Hardware refers to the physical parts of the computer that have mass (they can be touched). Hardware for a typical computer system include the following FIVE main categories : 1. Central Processing Unit (CPU) 2. Main Memory / Primary Storage / Internal Memory 3. Secondary Storage / Auxiliary Storage / External Memory 4. Input Devices 5. Output Devices LECTURE 1 6

Main Hardware Component Categories LECTURE 1 7

Central Processing Unit (CPU) Processor; Brain of the computer. Comprised of: Control Unit (CU) Retrieves, decodes and executes program instructions from RAM 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 LECTURE 1 8

CPU Organization LECTURE 1 9

Main Memory Main memory stores instructions and data while a program is running. It is volatile. Main memory is erased when program terminates or computer is turned off. Also called Random Access Memory (RAM) Consists of long list of memory locations Each contains zeros and ones Can change during program execution Each memory location is called a byte. It has eight bits. Binary Digit or Bit : A digit that can only be zero or one. Data and instructions (programs) are kept as binary digits. Address : A unique number that identifies a memory location. LECTURE 1 10

LECTURE 1 11

Main Memory Some data is too large for a single byte. Most integers and real numbers are too large. Next few consecutive bytes can store the additional bits for larger data. Address refers to the first byte. LECTURE 1 12

Main Memory LECTURE 1 13

Secondary Storage Secondary memory stores instructions and data between sessions Non-volatile: data is preserved when program is not running, or computer is turned off. Comes in a variety of media: magnetic: floppy disk drive (FDD), hard disk drive (HDD), magnetic tape drive optical: Compact Disc (CD), Digital Video Disc (DVD) flash memory : USB Flash drive LECTURE 1 14

Input Devices Devices that are sources to get input. Input is the information sent to the computer from the outside. Input consists of: A program Some data Many devices can provide INPUT: Keyboard, mouse, scanner, digital camera, microphone, barcode reader, joystick HDD, FDD, flash drive, magnetic tape, CD-ROM LECTURE 1 15

Output Devices Devices that send output. Output is information from the computer to the outside world. Many devices can be used for OUTPUT: Computer monitor, printer, projector, speaker, headphone, plotter HDD, FDD, flash drive, magnetic tape, CD-RW, DVD-RW LECTURE 1 16

LECTURE 1 17

Computer Software Software: refers to program that resides and executes electronically on the hardware. Software is divided into 2 categories Software System Software Application Software LECTURE 1 18

System Software Normally supplied by the manufacturer of the computer. Software that manages computer hardware resources, and the programs that run on them. Basic types of system software: BIOS, operating systems, utility programs, software development tools. The operating system is the most important type of system software. Without it, a user cannot run an application program on their computer, unless the application program is self booting. LECTURE 1 19

Operating System The operating system: Allows us to communicate with the computer Is a program Allocates the computer s resources Responds to user requests to run other programs Common operating systems include: UNIX Linux DOS Windows Macintosh VMS LECTURE 1 20

Application Software Programs that provide services (problem solution) to the user. Designed to perform a specific task (e.g. : course registration system, banking system) OR a generalpurpose task (e.g. : word processing, games). May be acquired by purchasing off-the-shelf or by designing for own purpose (custom made). Off-the-shelf : Prewritten and ready to use. For general-purpose task. Custom made : Written by in-house, consulting firm or software house. For specific task. LECTURE 1 21

Where are the application and system software? LECTURE 1 22

The Language of a Computer Machine language: language of a computer. Consists of binary digits (bits); sequences of 0s and 1s. 0 (signal off), 1 (signal on) Example : 1011010000000101 LECTURE 1 23

History Of Computer Languages Computer language evolution The only language understood by a computer is machine language LECTURE 1 24

History Of Computer Languages (cont.) 1. Machine Language Computer only understand this language. Series of 1 s and 0 s (binary numbers), such as 1011010000000101 Difficult to write. Low level language LECTURE 1 25

History Of Computer Languages (cont.) Early computers were programmed in machine language To calculate wages = rates * hours in machine language: 100100 010001 //Load 100110 010010 //Multiply 100010 010011 //Store LECTURE 1 26

History Of Computer Languages (cont.) 2. Symbolic/Assembly Language Unique to particular computer. Use mnemonics symbols. E.g. MUL Multiply Easier to understand. LECTURE 1 27

History Of Computer Languages (cont.) Using assembly language instructions, wages = rates x hours can be written as: LOAD rate MULT hours STOR wages Must be translated to machine language (zeros and ones) for the CPU to execute a program written in assembly language. LECTURE 1 28

History Of Computer Languages (cont.) 3. High-Level Language Are designed to be easy to read and write. Programmers use this language to write programs. Compiler: translates a program written in a high-level language to machine language Portable to many different computers. E.g. COBOL, FORTRAN, Visual Basic, Pascal, C, C++, C#, Java, Lisp, Ada The equation wages = rate x hours can be written in C++ as: wages = rate * hours; LECTURE 1 29

Some Well-Known High-Level Programming Languages LECTURE 1 30

History Of Computer Languages (cont.) 4. Natural Language Like our natural language (such as English, French, or Chinese) Its use is still quite limited. LECTURE 1 31

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

C++ evolved from C C++ History C++ designed by Bjarne Stroustrup at Bell Laboratories in early 1980s Overcame several shortcomings of C Incorporated object oriented programming C remains a subset of C++ C++ programs were not always portable from one compiler to another In mid-1998, ANSI/ISO C++ language standards were approved LECTURE 1 33

A simple C++ program begins this way #include <iostream> using namespace std; int main() { And ends this way } A Sample of C++ Program return 0; LECTURE 1 34

Example of a C++ Program #include <iostream> using namespace std; int main() { cout << "My first C++ program." << endl; cout << "The sum of 2 and 3 = " << 5 << endl; cout << "7 + 8 = " << 7 + 8 << endl; return 0; } Output of a sample Run : My first C++ program. The sum of 2 and 3 = 5 7 + 8 = 15 LECTURE 1 35

Program Development A computer understands a program only if the program is coded in its machine language. Programmer have to write the program and turn it into an executable code (machine language). Programmer have to understand the problem -> break into actions (write program)-> execute by the computer. LECTURE 1 36

From a High-level Program to an Executable Code Involves these processes: a) Editing : To create or edit file containing the program (source code) with a text editor. b) Compiling : The process involves the compiler. The compiler is actually two separate programs : preprocessor and translator. Firstly, preprocessor is run to convert source file directives (instructions that begin with #) to source code program statements. Secondly, the translator checks that the program obeys the rule. If all the rules are being obeyed, the translator convert the source code into machine language (object code). The two steps, are often performed by command COMPILE. Syntax errors detected will prevent execution of the following process. c) Linking : Run linker to connect system library functions code to the object code, producing an executable code. Performed by command BUILD. LECTURE 1 37

From a High-level Program to an Executable Code Programmer Programmer Code Programmer Code Executable Code LECTURE 1 38

Program Development (cont.) Then, after that to produce the result (output) of the program, there are another 2 processes : Loading : Loader loads the executable code/program into the main memory (RAM) Executing: The last step is to execute (run) the program to see the output of the program. These 2 processes are often performed by a single command DEBUG. LECTURE 1 39

Processing a C++ Program LECTURE 1 40

Testing and Debugging Bug A mistake in a program Debugging A process of eliminating mistakes in programs Term used when a moth caused a failed relay on the Harvard Mark 1 computer. Grace Hopper and other programmers taped the moth in logbook stating: First actual case of a bug being found. LECTURE 1 41

Program Errors Syntax errors Violation of the grammar rules of the language Discovered by the compiler Error messages may not always show correct location of errors Run-time errors Error conditions detected by the computer at run-time Logic errors Errors in the program s algorithm Most difficult to diagnose Computer does not recognize this error LECTURE 1 42

Integrated Development Environments (IDEs) An integrated development environment, or IDE, combine all the tools needed to write, compile, and debug a program into a single software application. Examples are Microsoft Visual C++, Borland C++ Builder, CodeWarrior, etc. LECTURE 1 43

Integrated Development Environments (IDEs) LECTURE 1 44

Professional Ethics for Computer Programmers Privacy and Misuse of Data Computer Hacking Plagiarism and Software Piracy Misuse of a Computer Resource -the end- 45 LECTURE 1