Introduction to Computer Programming Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University.

Slides:



Advertisements
Similar presentations
EC-111 Algorithms & Computing Lecture #1 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
Advertisements

4/23/2015Engineering Problem Solving with C++ second edition, J. ingber 1 Engineering Problem Solving with C++, Etter/Ingber Chapter 1.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Fundamentals and a Brief History of Computer Systems.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Chapter Chapter Goals Describe the layers of a computer system Describe the concept of abstraction and its relationship to computing Describe.
Java Environment (CSS444)
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
1 8/28/06CS150 Introduction to Computer Science 1 Professor: Chadd Williams
1 CS150 Introduction to Computer Science 1 Professor: Chadd Williams
Chapter 1- Visual Basic Schneider1 Chapter 1 An Introduction to Computers and Visual Basic.
1 Introduction to computers Overview l · Grading Policy »Cheating Rules (serious concern) »Examinations and Fixation of Timings »Quizzes »Homework Assignments.
August 29, 2005ICP: Chapter 0: Introduction to Computers and Computing 1 Introduction or Computer Programming Chapter 0: Introduction to Computers and.
1 Chapter 1 The Big Picture. 2 2 Computing systems are dynamic entities used to solve problems and interact with their environment. They consist of devices,
 2000 Prentice Hall, Inc. All rights reserved. 1 Introduction to Computers and C Programming Outline Introduction What Is a Computer? Computer Organization.
1 6 Abacus An early device to record numeric values Blaise Pascal Mechanical device to add, subtract, divide & multiply Joseph Jacquard Jacquard’s Loom,
Chapter 1 The Big Picture Chapter Goals Describe the layers of a computer system Describe the concept of abstraction and its relationship to computing.
 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 01 Nell Dale & John Lewis.
Introduction to Computers and Python. What is a Computer? Computer- a device capable of performing computations and making logical decisions at speeds.
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.
About the Presentations The presentations cover the objectives found in the opening of each chapter All chapter objectives are listed in the beginning.
BACS 287 Basics of Programming BACS 287.
Lecture 1 Introduction to computers & VB.Net. What is a Computer? Examples? A device capable of  Performing computation  Making logical decisions 
Spring 2005, Gülcihan Özdemir Dağ BIL104E: Introduction to Scientific and Engineering Computing, Spring Outline 1.1Introduction 1.2What Is a Computer?
Operating Systems CS3502 Fall 2014 Dr. Jose M. Garrido
Introduction to Computer & C Computers Computers are programmable machines capable of performing calculations Examples of special-purpose computers are.
Chapter 1 The Big Picture.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
CMSC 120: Visualizing Information 1/29/08 Introduction to Computing.
CPS120: Introduction to Computer Science Introduction to Computers.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Introduction to Computers Outline 1.1Introduction.
Advanced Computer Architecture 0 Lecture # 1 Introduction by Husnain Sherazi.
 2006 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 1 February 8, 2005.
1 MIS 131 Introduction to Algorithms and Programming 2015/2016 Fall - Chapter 1 -
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic.
General Concepts of Computer Organization Overview of Microcomputer.
Module 2 : Part 1 INTRODUCTION TO HARDWARE & SOFTWARE INTRODUCTION TO HARDWARE & SOFTWARE.
Computer Architecture And Organization UNIT-II General System Architecture.
COMPUTER PROGRAMMING. Computer programming the objective of the module to gain the necessary skills to develop a computer program using one of the high.
Computer Organization & Assembly Language © by DR. M. Amer.
Spring 09- ICE0124 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 1.
LECTURE#2 INTRODUCTION TO COMPUTERS, HISTORY AND APPLICATIONS INSTRUCTOR: M. MATEEN YAQOOB.
 2001 Prentice Hall, Inc. All rights reserved. Chapter 1 – Introduction to Computers, the Internet and the World Wide Web Outline 1.1Introduction 1.2What.
Problem Solving Techniques Using Pascal Allen C.-H. Wu Department of Computer Science Tsing Hua University Hsinchu, Taiwan 30043, ROC
Chapter 1 Getting Acquainted With Computers, Programs, and C++
CS1110: Computer Science I Chapter 1. What Is a Computer? A computer is a device capable of performing computations and making logical decisions At a.
CHAPTER 1.1 INTRODUCTION TO COMPUTERS AND C++ Dr. Shady Yehia Elmashad.
Chapter 1 An Overview of Computers and Programming Languages.
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Computer A Computer may be defined as an electronic device that operates upon data. So, a computer can store, process and retrieve data as and when desired.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
Software Development Environment
 2001 Prentice Hall, Inc. All rights reserved.
CSCI 161: Introduction to Programming
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1 The Big Picture
Chapter 1 – Introduction to Computers, the Internet, and the Web
Computer Organization and Architecture
Outline Introduction What Is a Computer? Computer Organization
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Introduction to Programming
UNIV 103 CS Majors Seminar Dr. Blaise W. Liffick Fall 2017.
Computer Science I CSC 135.
Computer Electronic device Accepts data - input
Introduction to Computer Programming
Computer components is a programmable machine that receives input, stores and manipulates data, and provides output in a useful format. Computer The computer.
Introduction to Computers, Internet and the World Wide Web
Presentation transcript:

Introduction to Computer Programming Nai-Wei Lin Department of Computer Science and Information Engineering National Chung Cheng University

2 Contents Introduction to computers and computer science Basic programming skills in programming language C Basic problem solving techniques

3 Chapter One Introduction to Computers

4 Computers Computers are programmable machines capable of performing calculations Examples of special-purpose computers are calculators and game-playing machines Examples of general-purpose computers are personal computers and notebooks

5 History of Computing Abacus – 2000 B. C. First mechanical calculator – Wilhelm Schickard, 1623 Mechanical machine (addition) – Blaise Pascal, 1640 Mechanical machine (multiplication/division) – Gottfried Leibniz, 1673 Difference engine and analytical engine (program) – Charles Babbage, 1871; first programmer – Augusta Ada Byron

6 History of Computing First vacuum tube electronic computer – John Atanasoff & Clifford Barry, 1939 Von Neumann Architecture – John von Neumann, 1946 First transistor electronic computer – IBM 7090, 1958 First integrated circuit electronic computer – IBM 360, 1964 First microprocessor electronic computer – Altair 8800, 1975

7 Hardware/Software A computer consists of hardware and software The hardware consists of various physical devices that performs wired and basic operations The software consists of various programs that coordinates basic operations to accomplish flexible and complex tasks

8 Programs A Program is a sequence of instructions (basic operations) to control the operation of the computer Programming is the task of designing programs Programming languages are notations used to represent the instructions of computers

9 Hardware storage unit input unit primary storage (memory) unit output unit secondary storage unit control unit arithmetic and logic unit (ALU) central processing unit (CPU) I/O unit control bus data bus

10 Control Unit Control unit repeatedly fetches instructions from memory unit to control unit via data bus Control unit then interprets instructions, and coordinates the operations of other units via control bus

11 Arithmetic and Logic Unit ALU is responsible for performing calculations based on arithmetic operations such as addition, subtraction, multiplication, and division ALU is also responsible for making decisions based on logical operations such as equality (=, ≠) and relation (, ≧ )

12 Arithmetic and Logic Unit Arithmetic or logical operations performed by ALU are controlled by control unit via control bus Data on which operations are performed are transferred from memory unit via data bus Data resulted from operations are transferred to memory unit via data bus

13 Primary Storage Unit Memory unit stores both instructions and data It retains information that is actively being used by the computer It is the short-term, rapid-access, low- capacity warehouse of the compute

14 Secondary Storage Unit Secondary storage unit retains information that is not actively being used by the computer It is the long-term, slow-access, high- capacity warehouse of the computer Common secondary storage devices are disks and tapes

15 Input Unit Input unit transfers information from various input devices to memory unit It also transforms information in human- readable form to information in machine- readable form Common input devices are keyboards and mouse devices

16 Output Unit Output unit transfers information from memory unit to various output devices It also transforms information in machine- readable form to information in human- readable form Common output devices are screens and printers

17 Users Software Application Programs Operating System Hardware

18 Operating System The operating system provides efficient management of the hardware so that application programmers can easily use the computer without knowing the detailed operations of the hardware Common operating systems are DOS, Windows 2000, Windows NT, Unix, Linux

19 Functions of Operating Systems System administration Job scheduling Memory management File management Input and output device management

20 Evolution of Operating Systems Simple batch systems Multiprogrammed batch systems Time-sharing systems Parallel systems Distributed systems

21 Application Programs An application program allows users to use a computer to solve problems in a specific domain without knowing the details of the computer Common application programs are MS Word, MS Excel, MS Access, MS Internet Explorer, Netscape Communicator

22 Programming Languages High-level language Compiler Assembly language Assembler Machine language

23 Machine Languages A computer can directly understand only its own machine language A program denoted by a machine language consists of strings of numbers (1's and 0's) Machine languages are machine-dependent

24 An Example InputOutput : : : : ALU

25 Assembly Languages The assembly language of a computer is a mnemonic representation of its machine language and is also machine-dependent An assembler converts assembly language programs into machine language programs Each assembly instruction is usually converted into one machine instruction

26 An Example INPUT English INPUT Chinese LOAD English ADD Chinese STORE Total OUTPUT Total InputOutput : : : : ALU English Chinese Total

27 An Example INPUT English INPUT Chinese LOAD English ADD Chinese STORE Total OUTPUT Total

28 High-Level Languages A high-level language uses English-like notations and commonly used mathematical notations A standardized high-level language is machine-independent or portable

29 Compilers A compiler translates high-level language programs into assembly language programs or machine language programs Each high-level instruction is usually translated into several assembly instructions

30 An Example Input(English); Input(Chinese); Total = English + Chinese; Output(Total); InputOutput : : : : ALU English Chinese Total

31 An Example Input(English);INPUT English Input(Chinese); INPUT Chinese Total = English + Chinese; LOAD English ADD Chinese STORE Total Output(Total); OUTPUT Total

32 Computer Science Computer science is more concerned with the software or the science of problem solving Computer engineering is more concerned with the hardware or the engineering of computing machines Hardware costs have been declining dramatically; software costs have been rising steadily

33 Algorithms An algorithm is an abstract strategy for solving a problem Solving a problem by computer consists of designing an algorithm and expressing the algorithm as a program

34 An Example:Finding the GCD M N R = 27 x = 18 x = 9 x ~3 4

35 An Example:Finding the GCD Store M and N the value of the larger and smaller of the two input values, respectively Divide M by N, and store the remainder R If R is not 0, then store M the value of N, store N the value of R, and return to step 2 Otherwise, the GCD is the current value of N

36 An Example:Finding the GCD Input(M); Input(N); Do { Q = M / N; R = M % N; M = N; N = R; } While (R != 0); Output(N);