Chapter 1 Introduction to Computers and C++ Programming

Similar documents
0 Introduction: Computer systems and program development

Introduction to Computers, the Internet and the Web Pearson Education, Inc. All rights reserved.

C++ Programming Language Lecture 1 Introduction

Fundamentals of Programming. Lecture 1: Introduction to C Programming

by Pearson Education, Inc. All Rights Reserved.

Structured Languages. Rahul Deodhar

Instructor. Mehmet Zeki COSKUN Assistant Professor at the Geodesy & Photogrammetry, Civil Eng. (212)

These all slide pages are selected from C How to Program, 5/e and 7/e Asst.Prof.Dr.Mahmut YALCIN

Introduction to C++ Programming. Adhi Harmoko S, M.Komp

Chapter 1 Introduction to Computers and C++ Programming

Introduction to Computers and Visual Basic.Net Pearson Education, Inc. All rights reserved.

Introduction to Programming

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

Chapter 1 Introduction to Computers and C++ Programming

Internet and Visual Basic Pearson Education, Inc. All rights reserved.

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

INTRODUCTION TO THE COURSE

Chapter 1: Introduction

Chapter 1 & 2 Introduction to C Language

Computer Fundamentals

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

Chapter 1: Introduction to Computers and Programming

Chapter 1 Overview of Programming and Problem Solving By C.K. Liang

Computer Principles and Components 1

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

Software Concepts. It is a translator that converts high level language to machine level language.

Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/os, etc.

Lecture 1: Preliminaries

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

Fundamentals of Programming (C)

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

INFS 214: Introduction to Computing

Module 1: Introduction

Computer Programming-1 CSC 111. Chapter 1 : Introduction

BIL 104E Introduction to Scientific and Engineering Computing. Lecture 1

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

IS 0020 Program Design and Software Tools

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

Introduction to Programming

Module 1: Introduction. What is an Operating System?

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

Module 1: Introduction

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

Chapter 1: Introduction

Contents. Today's Topic: Introduction to Operating Systems

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

Introduction to Computers and Java

Introduction to Computers and Java

(0) introduction to the course. how to learn a programming language. (0) course structure

Welcome (back) to CS1007!

Programming 1 - Honors

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

Fundamentals of Programming Session 1

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

last time in cs recitations. computer commands. today s topics.

Introduction to Computers

OPERATING SYSTEMS OVERVIEW

CHAPTER 1 Introduction to Computers and Java

SCSP Programming Technique C

Introduction to Computers, the Internet and the World Wide Web

Chapter 2 Operating-System Structures

Introduction to Computers and Java

Chapter 1 Introduction to Computers and Programming

Fundamentals of Programming Session 1

Java and Software Design

Introduction to Operating System

Operating System. Operating Systems Structure Chapter 2. Services Provided by the OS. Evolution of an Operating System

EKT 120/4 Computer Programming KOLEJ UNIVERSITI KEJURUTERAAN UTARA MALAYSIA

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

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

Fundamentals of Programming Session 2

Chapter 1: Introduction

Operating Systems CS3502 Spring 2018

OPERATING SYSTEMS. P. PRAVEEN Asst.Prof, CSE

Object Oriented Design

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

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

Chapter 1 Computer and Programming. By Zerihun Alemayehu

Unit 2 : Computer and Operating System Structure

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

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

Computer Science & Engineering 150A Problem Solving Using Computers

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

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

9/11/08 (c) 2008 Matthew J. Rutherford Class (c) 2008 Matthew J. Rutherford Class

Topics. Operating System. What is an Operating System? Let s Get Started! What is an Operating System? Where in the Book are we?

Operating Systems Fundamentals. What is an Operating System? Focus. Computer System Components. Chapter 1: Introduction

CSC 453 Operating Systems

Introduction. What is an Operating System? A Modern Computer System. Computer System Components. What is an Operating System?

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

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

OPERATING SYSTEMS. Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne

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

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

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

CHAPTER-1: INTRODUCTION TO OPERATING SYSTEM:

Chapter 2: Operating-System Structures

Introduction to Computers and the Internet Pearson Education, Inc. All rights reserved.

OPERATING SYSTEM. Functions of Operating System:

Transcription:

Chapter 1 Introduction to Computers and C++ Programming 1 Outline 1.1 Introduction 1.2 What Is a Computer? 1.3 Computer Organization 1.4 Evolution of Operating Systems 1.5 Personal Computing, Distributed Computing and Client/Server Computing 1.6 Machine Languages, Assembly Languages and High-level Languages 1.7 The History of C 1.8 The C Standard Library 1.9 The Key Software Trend: Object Technology 1.10 C++ and C++ How to Program 1.11 Java and Java How to Program 1.12 Other High-level Languages 1.13 Structured Programming 1.14 The Basics of a typical C Program Development Environment

Chapter 1 Introduction to Computers and C++ Programming 2 Outline 1.15 Hardware Trends 1.16 History of the Internet 1.17 History of the World Wide Web 1.18 General Notes About C and this Book

Objectives 3 In this chapter, you will learn: To understand basic computer concepts. To become familiar with different types of programming languages. To become familiar with the history of the C programming language. To become aware of the C standard library. To understand the elements of a typical C program development environment. To appreciate why it is important to learn C in a first programming course. To appreciate why C provides a foundation for further study of programming languages in general.

4 1.1 Introduction We will learn The C programming language Structured programming and proper programming techniques This course is appropriate for Technically oriented people with little or no programming experience Experienced programmers who want a deep and rigorous treatment of the language

5 1.2 What is a Computer? Computer Device capable of performing computations and making logical decisions Computers process data under the control of sets of instructions called computer programs Hardware Various devices comprising a computer Keyboard, screen, mouse, disks, memory, CD-ROM, and processing units Software Programs that run on a computer

1.3 Computer Organization 6 Six logical units in every computer: 1. Input unit Obtains information from input devices (keyboard, mouse) 2. Output unit Outputs information (to screen, to printer, to control other devices) 3. Memory unit Rapid access, low capacity, stores input information 4. Arithmetic and logic unit (ALU) Performs arithmetic calculations and logic decisions 5. Central processing unit (CPU) Supervises and coordinates the other sections of the computer 6. Secondary storage unit Cheap, long-term, high-capacity storage Stores inactive programs

7 1.4 Evolution of Operating Systems Batch processing Do only one job or task at a time Operating systems Manage transitions between jobs Increased throughput Amount of work computers process Multiprogramming Computer resources are shared by many jobs or tasks Timesharing Computer runs a small portion of one user s job then moves on to service the next user

1.5 Personal Computing, Distributed Computing, and Client/Server Computing Personal computers Economical enough for individual Distributed computing Computing distributed over networks Client/server computing Sharing of information across computer networks between file servers and clients (personal computers) 8

1.6 Machine Languages, Assembly Languages, and High-level Languages Three types of programming languages 1. Machine languages Strings of numbers giving machine specific instructions Example: +1300042774 +1400593419 +1200274027 2. Assembly languages English-like abbreviations representing elementary computer operations (translated via assemblers) Example: LOAD BASEPAY ADD OVERPAY STORE GROSSPAY 9

1.6 Machine Languages, Assembly Languages, and High-level Languages Three types of programming languages (continued) 3. High-level languages Codes similar to everyday English Use mathematical notations (translated via compilers) Example: grosspay = basepay + overtimepay 10

11 1.7 History of C C Evolved by Ritchie from two previous programming languages, BCPL and B Used to develop UNIX Used to write modern operating systems Hardware independent (portable) By late 1970's C had evolved to "Traditional C" Standardization Many slight variations of C existed, and were incompatible Committee formed to create a "unambiguous, machineindependent" definition Standard created in 1989, updated in 1999

12 1.8 The C Standard Library C programs consist of pieces/modules called functions A programmer can create his own functions Advantage: the programmer knows exactly how it works Disadvantage: time consuming Programmers will often use the C library functions Use these as building blocks Avoid re-inventing the wheel If a premade function exists, generally best to use it rather than write your own Library functions carefully written, efficient, and portable

1.9 The Key Software Trend: Object Technology Objects Reusable software components that model items in the real world Meaningful software units Date objects, time objects, paycheck objects, invoice objects, audio objects, video objects, file objects, record objects, etc. Any noun can be represented as an object Very reusable More understandable, better organized, and easier to maintain than procedural programming Favor modularity 13

14 1.12 Other High-level Languages Other high-level languages FORTRAN Used for scientific and engineering applications COBOL Used to manipulate large amounts of data Pascal Intended for academic use

15 1.13 Structured Programming Structured programming Disciplined approach to writing programs Clear, easy to test and debug and easy to modify Multitasking Specifying that many activities run in parallel

1.14 Basics of a Typical C Program Development Environment Phases of C++ Programs: 1. Edit 2. Preprocess 3. Compile 4. Link 5. Load 6. Execute Editor Preprocessor Compiler Linker Loader Disk CPU Disk Disk Disk Disk Primary Memory Primary Memory...... 16 Program is created in the editor and stored on disk. Preprocessor program processes the code. Compiler creates object code and stores it on disk. Linker links the object code with the libraries Loader puts program in memory. CPU takes each instruction and executes it, possibly storing new data values as the program executes.

17 1.15 Hardware Trends Every year or two the following approximately double: Amount of memory in which to execute programs Amount of secondary storage (such as disk storage) Used to hold programs and data over the longer term Processor speeds The speeds at which computers execute their programs

1.16 History of the Internet 18 The Internet enables Quick and easy communication via e-mail International networking of computers Packet switching The transfer of digital data via small packets Allows multiple users to send and receive data simultaneously No centralized control If one part of the Internet fails, other parts can still operate TCP/IP Bandwidth Information carrying capacity of communications lines

19 1.17 History of the World Wide Web World Wide Web Locate and view multimedia-based documents on almost any subject Makes information instantly and conveniently accessible worldwide Possible for individuals and small businesses to get worldwide exposure Changing the way business is done

1.18 General Notes About C and This Book Program clarity Programs that are convoluted are difficult to read, understand, and modify C is a portable language Programs can run on many different computers However, portability is an elusive goal We will do a careful walkthrough of C Some details and subtleties are not covered If you need additional technical details Read the C standard document Read the book by Kernigan and Ritchie 20