1 204111 Computers and Programming อนันต์ ผลเพิ่ม Anan Phonphoem

Slides:



Advertisements
Similar presentations
Computer Science Department Introduction To Computers and Programming Knowledge: Understand the concepts of computer, hardware, software and programming.
Advertisements

Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
COSC 120 Computer Programming
CS 201 Overview of Computers & Programming Debzani Deb.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
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
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
CIS 260 Computer Programming I in C Prof. Timothy Arndt.
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
CS102 Introduction to Computer Programming
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Computer Hardware Computer Technology Jeopardy Review By C. Lyman © July 2007.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
CS 161 INTRO TO PROGRAMMING I Dr. Blaise W. Liffick Fall
Chapter Introduction to Computers and Programming 1.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Chapter 1 An Overview of Computers and Programming Languages.
Computer & Communications Systems Software Development Unit 1.
COP1220/CGS2423 Introduction to C++/ C for Engineers Professor: Dr. Miguel Alonso Jr. Fall 2008.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
CISC105 General Computer Science Class 1 – 6/5/2006.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
2.0 Computer System.
1 nd Semester Module1 Introduction to Computer and Programming Thanawin Rakthanmanon Create by: Aphirak Jansang Computer.
Computer Parts. Two Basic Parts Hardware & Software.
CPS120: Introduction to Computer Science Introduction to Computers.
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1 – Computing Fundamentals. History of Electronic Computers u First computer –ABC (Atanasoff Berry Computer) at Iowa State U. –1930’s –Solved.
Introduction to Computer and Programing Thanachat Thanomkulabut.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic.
Introduction to Computer and Programing Thanachat Thanomkulabut.
1 st semester Basic Pascal Elements อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
1 st Semester Introduction to Computer and Programming Computer Engineering Department Kasetsart University, Bangkok, THAILAND.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Problem Solving Techniques Using Pascal Allen C.-H. Wu Department of Computer Science Tsing Hua University Hsinchu, Taiwan 30043, ROC
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Introduction to Computer and Programing Thanachat Thanomkulabut.
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
2 nd Semester Module1 Introduction to Computer and Programming อภิรักษ์ จันทร์สร้าง Aphirak Jansang
Computers and Programming ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Introduction to Computer and Programing Thanachat Thanomkulabut.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
 A computer is an electronic device that receives data (input), processes data, stores data, and produces a result (output).  It performs only three.
Chapter 1 An Overview of Computers and Programming Languages.
2 nd Semester Module1 Introduction to Computer and Programming อภิรักษ์ จันทร์สร้าง Aphirak Jansang
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
CHAPTER 1 OVERVIEW OF COMPUTER AND PROGRAMMING 1.1 Electronic Computer Then and Now 1.2 Computer Hardware 1.3 Computer Software 1.4 The Software Development.
BASIC PROGRAMMING C SCP1103 (02)
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
BASIC PROGRAMMING C SCP1103 (02)
Overview of Computers and Programming Chapter 1
Introduction to Programming
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Unit One - Computing Fundamentals
Presentation transcript:

Computers and Programming อนันต์ ผลเพิ่ม Anan Phonphoem

2 Outline Intro to computer Computer components How can we load and run program? Programming languages Problem solving and programming Programming strategy Intro to Pascal Program structure Basic elements (reserved words, identifiers)

3 Categories of Computers Microcomputer Personal Computer, Desktop computer Notebook, Laptop, Palmtop Use by one person at a time Minicomputer Faster speed Many users at the same time Mainframe -> Supercomputer High computation power

4 Categories of Computers Workstation CAD Workstation Unix Workstation Server Client /Server (Networks)

5 Computer Components

6 CPU Main Memory HD Computer Components Secondary Memory Input Devices Output Devices

7 Computer Memory 1. Main Memory 2. Secondary Memory

8 1. Main Memory Store information A 23 W Memory Cell Memory Address

9 1. Main Memory Memory Cell  Byte  Bit 1 Byte = 8 bits Can be divided into 2 Categories RAM (Random Access Memory) ROM (Read Only Memory)

10 2. Secondary Memory (Storage) Floppy disk Hard disk CD-ROM Tape Information called “ file ” (data file, output file, program file) 1 Kbyte = 2 10 = 1024 bytes 1 Mbyte = 2 20 = 1,048,576 bytes 1 Gbyte = 2 30 = 1,073,741,824 bytes

11 Main VS. Secondary Memory Main Memory Much faster More expensive Volatile (RAM) Secondary Memory Slower Less expensive Permanent

12 CPU Main Memory HD Computer Components Secondary Memory Input Devices Output Devices

13 Central Processor Unit (CPU) Retrieve information from memory Calculate Put back results to memory Intel / AMD (Pentium / Athlon)

14 How can we load and run program? Boot process Load OS into Memory Tell user to load and run Program “ p1 ” User start using program HW OS Secondary Storage p1 USER

15 Programming Language Machine Language Assembly Language High-Level Language CPU can execute only the machine language

16 How can a non-machine language program be executed? 2 methods Interpretation Translation

17 The interpretation Process Source Program Input Data Interpreter (on computer) Output

18 Translation Process Translation Phase Link Phase Execute Phase Source Program Translator Object Program Library Linker Execute Program Output CPUInput Data

19 Translators Assembler (assembly) Compiler (High-level language)

20 High-Level Languages Procedural Language Fortran Cobol Basic C Pascal Object-Oriented Language C++ Functional Language Lisp Logic Language Prolog

21 Problem Solving and Programming Solve Problems Combine art and science Art Transform a description (word to equation) Difficult (problem is not clear, input, output) Science Knowledge of problems Equation and formula

22 Programming Strategy Don ’ t rush to key in the computer Think carefully about the problem Try to solve by hand Plan your program Test by hand if possible Start programming Program Compilation Testing / Debug Documentation Maintenance

23 Introduction to Pascal Procedural programming language Developed by Prof.Niklaus Wirth (Switzerland, 1970s) Named in honor to mathematician, Blaise Pascal Most popular -> Turbo Pascal

24 Pascal Program Structure Program Heading Declarations Main Routine (Program body)

25 Pascal Program Structure program myFirstProgram; const myStudentId = ; var courseTaken: integer; begin write( ‘ Please Enter a number of courses ’ ); read( ‘ courseTaken ’ ); writeln( ‘ Student ’, myStudentId, ‘ takes ’, courseTaken, ‘ courses in this semester ’ ); end. Program Heading Declarations Program Body

26 Basic Elements of Pascal Character set Reserved words Identifiers Constants / Variables Statement / Expression Function / Procedure

27 Character Set Three categories Letter (A … Z, a … z) Digit (0 … 9) Special character (+ - * / _ = ! <> []{})

28 Reserved Words ( คำสงวน ) Predefined meaning and usage Cannot be redefined by the programmer Examples program begin / end const / var etc.

29 Reserved Words ( คำสงวน ) program myFirstProgram; const myStudentId = ; var courseTaken: integer; begin write( ‘ Please Enter a number of courses ’ ); read( ‘ courseTaken ’ ); writeln( ‘ Student ’, myStudentId, ‘ takes ’, courseTaken, ‘ courses in this semester ’ ); end.

30 Identifiers ( คำบ่งช ี้ ) Symbolic names for program elements Program name Variable name Data Type name Etc. Rules for constructing identifiers Letters, digits, and under score (_) First character  letter Can be long (63 char) Reserved words are not allowed

31 Identifiers ( คำบ่งช ี้ ) program myFirstProgram; const myStudentId = ; var courseTaken: integer; begin write( ‘ Please Enter a number of courses ’ ); read( ‘ courseTaken ’ ); writeln( ‘ Student ’, myStudentId, ‘ takes ’, courseTaken, ‘ courses in this semester ’ ); end.

32 Identifier examples Valid examples score, count, total score1, count99, total09 score_1, count_99, total_99 myStudentId my_student_id Invalid examples point&score total-number 9points

33 Notes for Identifiers Identifiers are case-insensitive mystudentId Mystudentid MYSTUDENTID Some identifiers are predefined meanings (Standard Identifiers) interger, real write, writeln, read, readln

34 Standard Identifiers program myFirstProgram; const myStudentId = ; var courseTaken: integer; begin write( ‘ Please Enter a number of courses ’ ); read( ‘ courseTaken ’ ); writeln( ‘ Student ’, myStudentId, ‘ takes ’, courseTaken, ‘ courses in this semester ’ ); end.