CS1061 C Programming (5 credits) Lecturer: Adrian O’Riordan Contact: is office is 312, Kane Lectures:

Slides:



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

Lecture 1: Overview of Computers & Programming
COSC 120 Computer Programming
Introduction to Computers and Programming - Class 1 1 Introduction to Computers and Programming Professor Avi Rosenfeld.
Three types of computer languages
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 1 – Introduction to Computers and C++ Programming.
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
Introduction to C++ Programming CS 117 Section 2 and KNET Sections Spring 2001 MWF 1:40-2:30.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 1 – Introduction to Computers and C++ Programming Outline 1.1Introduction 1.2What Is a Computer?
Ceng 230 Programming with C
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.
C PROGRAMMING LECTURE C-language Computer Fundamentals.
 2000 Prentice Hall, Inc. All rights reserved. 1 Introduction to Computers and C Programming Outline Introduction What Is a Computer? Computer Organization.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
CS102 Introduction to Computer Programming
 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.
Introduction to Programming G50PRO University of Nottingham Unit 1 : Introduction Paul Tennent
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.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction COMP104: Fundamentals and Methodology.
“C” Programming Language What is language ? Language is medium of communication. If two persons want to communicate with each other, they have to use.
BACS 287 Basics of Programming BACS 287.
Programming Design Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
Chapter 1 Engineering Problem Solving 1. Hardware and Software 2 A computer is a machine designed to perform operations specified with a set of instructions.
Spring 2005, Gülcihan Özdemir Dağ BIL104E: Introduction to Scientific and Engineering Computing, Spring Outline 1.1Introduction 1.2What Is a Computer?
CISC105 General Computer Science Class 1 – 6/5/2006.
What is a Computer? An, electrical machine, that can be programmed to accept data (input), process it into useful information (output) and store it away.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 1 – Car Payment Calculator and Guess the Number.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Introduction Lecture 01.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Introduction to Computers Outline 1.1Introduction.
Introduction to Programming Lecture No. 1. Books  Deitel & Deitel :– C++ How to Program  Kernighan and Ritchie:- The C Programming Language.
 2006 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 1 Introduction to Computers, the Internet and.
Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI CSCI.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 1 February 8, 2005.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Programming Fundamentals1 Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING.
1 MIS 131 Introduction to Algorithms and Programming 2015/2016 Fall - Chapter 1 -
1 Programming Fundamentals How to Program in C++ How to Program in C++
COMPUTER PROGRAMMING. Computer programming the objective of the module to gain the necessary skills to develop a computer program using one of the high.
Spring 09- ICE0124 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 1.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
 2001 Prentice Hall, Inc. All rights reserved. Chapter 1 – Introduction to Computers, the Internet and the World Wide Web Outline 1.1Introduction 1.2What.
CS2301:Computer Programming 2
Programming Fundamentals Lecture No. 2. Course Objectives Objectives of this course are three fold 1. To appreciate the need for a programming language.
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
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.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 1 – Introduction to C.
Introduction to C Programming Language. History of C  C was evolved by Dennis Ritchie at AT&T Bell Laboratories in early of 1970s  Successor of: ALGOL.
Chapter 1 An Overview of Computers and Programming Languages.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming Dr. Halla Abdel Hameed.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Introduction to Programming By: Prof. Muhammad Abu Baker Siddique 2 nd Lecture 1.
 2001 Prentice Hall, Inc. All rights reserved.
Lecture 1: Introduction to JAVA
Intro to Programming Week # 1 Hardware / Software Lecture # 2
1.6 Machine Languages, Assembly Languages, and High-level Languages
Programming COMP104: Fundamentals and Methodology Introduction.
Introduction to Computer Programming
Presentation transcript:

CS1061 C Programming (5 credits) Lecturer: Adrian O’Riordan Contact: is office is 312, Kane Lectures: 24 in total Kane Building O’Rahilly Building Practicals:Organised later in year (12 hours) Assessment: Total Marks 100: End of Year Written Examination (1½hr paper) 80 marks; Continuous Assessment 20 marks.

Objectives Module Objective: To teach fundamental techniques of computer programming using the C language. Module Content: Principles of programming: algorithms, design and specification; testing and debugging. Fundamentals of C programming: data types; operators; expressions; control structures; console and file i/o. Program structure: functions, recursion, standard libraries. Aggregate data types: arrays; pointers; strings; records. Dynamic data structures: allocation; deallocation; memory management; list structures.

Reading material The Boole library has a number of good books on C: C for scientists and engineers / Richard Johnsonbaugh, Martin Kalin, Prentice Hall, A book on C : programming in C / Al Kelley, Ira Pohl, Addison- Wesley, C : how to program / H. M. Deitel, P. J. Deitel, Prentice-Hall, There are also a number of good tutorials freely available on the WWW.

The computer The primary components of a computer are the central processing unit (CPU), arithmetic and logic unit, main memory, and various input/output devices. This is the hardware. The programs that run on a computer are the software. The CPU controls the execution of these programs using its own internal clock. A computer program is a sequence of instructions issued to a computer. The instructions are stored in the computer’s memory.

Instructions The instructions are read from memory one-by-one by the computer processor. Main memory is fast to access. Secondary storage, i.e. hard disks, is typically slower to access but much larger in capacity. Program instructions are read and executed extremely quickly by a computer compared to human speeds. (For example, an instruction (executed in a single clock cycle) on a 3GHz processor could potentially be executed in 0.33 nanoseconds. Programs often perform input (from keyboard/mouse) and output (to terminal) functions in addition to executing instructions. This tends to be much slower.

Programming languages Programs are written in a programming language. The earliest programming languages were all low-level such as machine code and assembler. Low-level languages are hard and tedious to write but tend to execute quickly. High-level languages have a more structured form and English-like syntax. A program called a compiler (or interpreter) is used to translate the high-level source into machine code that the computer can understand. The development of higher-level languages greatly increased programming productivity.

Examples of Languages Example taken from Dietel and Dietel 1.Machine language - strings of numbers giving machine specific instructions Assembly languages LOAD BASEPAY ADD OVERPAY STORE GROSSPAY 3.High-level languages - Code similar to everyday English grossPay = basePay + overTimePay

Problem Solving Programming is a form of problem solving. Faced with the requirement to implement a solution to a problem, the programming has to translate the problem description into a language a computer can understand. Though requirements may be expressed as clearly, succinctly and unambiguously as possible, there is still a lot of scope for errors, omissions and inconsistencies. Implementation can introduce a new layer of errors. Thus software development has a reputation for being hard, and cannot be fully automated. A key idea in computer science is that of an algorithm (see later)

Introducing C C is a high-level language that also retains many features of low-level programming. C is very fast – as fast as machine code on many platforms. Thus C is the first choice for developers concerned with performance, for example in applications such as embedded systems, real time systems, and reconfigurable hardware. C was probably the world’s most widely used programming language until more recently being challenged by the rise of Java. A lot of modern programming languages, such as C++ and Java, are influenced and retain a similar syntax to C.

Advantages of C Widely adopted industry standard Very fast Supports structured programming (see later) Relatively small number of commands and keywords Powerful pointer-based implementation (see later) Low-level (bit-wise) operations (see later) Supports dynamic memory allocation (see later) Code libraries available (See later)

Background Context History C was developed at Bell labs. c by Martin Ritchie based on Martin Richard’s BCPL (1967) and Ken Thompson’s B language (1970). C was initially used predominantly for systems programming, but is now very much a general-purpose language. It has been ported to a large number of platforms including Windows, Macintosh and many flavours of UNIX. Standardisation Initially many slight variations of C existed, and were incompatible so a committee was formed to create a unambiguous, machine- independent definition. ISO Standard created in 1989 (most widely used) and updated in 1999 (C99).

Related Languages C++ - The C++ programming language was derived from C and has object-oriented functionality with C-like syntax. Objective-C - Objective-C is a very "thin" layer on top of, and is a strict superset of C Java and C#- Modern languages that retain the basic C syntax