Programming Fundamentals Lecture No. 2. Course Objectives Objectives of this course are three fold 1. To appreciate the need for a programming language.

Slides:



Advertisements
Similar presentations
C++ Introduction.
Advertisements

Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 1 Engineering Problem Solving.
EC-111 Algorithms & Computing Lecture #1 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Introduction to Programming Lecture 2. Today’s Lecture Software Categories Software Categories System Software System Software Application Software Application.
Systems Software.
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
Three types of computer languages
B-1 Lecture 2: Problems, Algorithms, and Programs © 2000 UW CSE University of Washington Computer Programming I.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and 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.
1 CHAPTER 4 LANGUAGE/SOFTWARE Hardware Hardware is the machine itself and its various individual equipment. It includes all mechanical, electronic.
CHAPTER 1: INTORDUCTION TO C LANGUAGE
COMPUTER SOFTWARE Chapter 3. Software & Hardware? Computer Instructions or data, anything that can be stored electronically is Software. Hardware is one.
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
CS102 Introduction to Computer Programming
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Chapter Introduction to Computers and Programming 1.
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANCI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
“C” Programming Language What is language ? Language is medium of communication. If two persons want to communicate with each other, they have to use.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Software Concepts. Software & Hardware? Computer Instructions or data, anything that can be stored electronically is Software. Hardware is one that is.
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.
I NTRODUCTION TO P ROGRAMMING Lecture No. 1 and 2 Combined Lahore Leads University 21 st October 2013.
CSC141 Introduction to Computer Programming
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
History of C and C++ C++ evolved from C ANSI C C++ “spruces up” C
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.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice:
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
Introduction to Programming Lecture No. 1. Books  Deitel & Deitel :– C++ How to Program  Kernighan and Ritchie:- The C Programming Language.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Robert Crawford, MBA West Middle School.  Explain how the binary system is used by computers.  Describe how software is written and translated  Summarize.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
EG280 Computer Science for Engineers Fundamental Concepts Chapter 1.
Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”
Computing Systems & Programming ECE Fundamental Concepts Chapter 1 Engineering Problem Solving.
CS-303 Introduction to Programming
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
© 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.
An overview of C Language. Overview of C C language is a general purpose and structured programming language developed by 'Dennis Ritchie' at AT &T's.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
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
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
THE SOFTWARE Computers need clear-cut instructions to tell them what to do, how to do, and when to do. A set of instructions to carry out these functions.
Introduction to Programming By: Prof. Muhammad Abu Baker Siddique 2 nd Lecture 1.
Evolution and History of Programming Languages
DDC 2223 SYSTEM SOFTWARE DDC2223 SYSTEM SOFTWARE.
System Programming and administration
Instructor: Chien-Ho Ko
History of ‘C’ Root of the morden language is ALGOL It’s first
Intro to Programming Week # 1 Hardware / Software Lecture # 2
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANSI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
TRANSLATORS AND IDEs Key Revision Points.
Introduction to Computer Programming
Chapter 1 Introduction to Programming
System Programming By Prof.Naveed Zishan.
Presentation transcript:

Programming Fundamentals Lecture No. 2

Course Objectives Objectives of this course are three fold 1. To appreciate the need for a programming language 2. To introduce the concept and usability of the structured programming methodology 3. To develop proficiency in making useful software using the C language

Critical Skills  Analysis  Critical Thinking*  Attention to Detail

Design Recipe To design a program properly, we must:  Analyze** a problem statement, typically expressed as a word problem  Express its essence, abstractly and with examples  Formulate statements and comments in a precise language  Evaluate and revise the activities in light of checks and tests

PAY ATTENTION TO DETAIL  These skills are useful for anybody

Computers are STUPID

Humans are even more…….

Think Reuse

 Think Reuse  Think User Interface  Comments liberally

Logical Error Lewis Carol: “Through the Looking Glass” “Twas brillig, and the slithy toves Did gyre and gimble in the wabe “

Software Categories Software is categorized into two main categories  o System Software  o Application Software

System Software  The system software controls the computer. It communicates with computer’s  hardware (key board, mouse, modem, sound card etc) and controls different aspects of  operations. Sub categories of system software are:  o Operating system  o Device drivers  o Utilities

Application software  A program or group of programs designed for end users. For example a program for Accounting, Payroll, Inventory Control System, and guided system for planes. GPS (global positioning system), another application software, is being used in vehicles, which through satellite determines the geographical position of the vehicle

History of C Dennis Ritchie developed a general purpose language, called C language, by using different features of BCPL and B languages. C uses many important concepts of BCPL and B while adding data typing and other features. In the start C became widely known as the development language of the UNIX operating system, and the UNIX operating system was written by using this C language. The C language is so powerful that the compiler of C and other various operating systems are written in C. C language has almost unlimited powers to do with computers. You can program to turn on or off any device of computer. You can do a lot to hard disk and other peripherals. It is very easy to write a program in C that stops the running of computer. So be careful while programming in C.

History The C language and UNIX operating system widely spread in educational and research institutions. There was C and UNIX everywhere. Due to the wide spread of C, different researchers started to add their features in the language. And thus different variations in C came into existence. Many universities developed their own C by adding different features to the C language developed by Ritchie. These variations led to the need of a standard version of C. In 1983 a technical committee was created under the American National Standards Committee on Computer and Information Processing to provide an unambiguous and machine- independent definition of the language. In 1989 the standard was approved. ANSI cooperated with the International Standard Organization (ISO) to standardize C worldwide.

Tools of the trade As programmer we need different tools to develop a program. These tools are needed for the life cycle of programs  Editor  Interpreter and Compilers  Debuggers

Editors First of all we need a tool for writing the code of a program. For this purpose we used Editors in which we write our code. We can use word processor too for this, but word processors have many other features like bold the text, italic, coloring the text etc, so when we save a file written in a word processor, lot of other information including the text is saved on the disk. For programming purposes we don’t need these things we only need simple text. Text editors are such editors which save only the text which we type. So for programming we will be using a text editor

Compiler and Interpreter As we write the code in English and we know that computers can understand only 0s and 1s. So we need a translator which translates the code of our program into machine language. There are two kinds of translators which are known as Interpreter and Compilers. These translators translate ourprogram which is written in C-Language into Machine language. Interpreters translates the program line by line meaning it reads one line of program and translates it, then it reads second line, translate it and so on. The benefit of it is that we get the errors as we go along and it is very easy to correct the errors. The drawback of the interpreter is that the program executes slowly

as the interpreter translates the program line by line. Another drawback is that as interpreters are reading the program line by line so they cannot get the overall picture of the program hence cannot optimize the program making it efficient.

Compilers also translate the English like language (Code written in C) into a language (Machine language) which computers can understand. The Compiler read the whole program and translates it into machine language completely. The difference between interpreter and compiler is that compiler will stop translating if it finds an error and there will be no executable code generated whereas Interpreter will execute all the lines before error and will stop at the line which contains the error. So Compiler needs syntactically correct program to produce an executable code. We will be using compiler in our course

Debugger Another important tool is Debugger. Every programmer should be familiar with it. Debugger is used to debug the program i.e. to correct the logical errors. Using debugger we can control our program while it is running. We can stop the execution of our program at some point and can check the values in different variables, can change these values etc. In this way we can trace the logical errors in our program and can see whether our program is producing the correct results. This tool is very powerful, so it is complex too

Linker Most of the time our program is using different routines and functions that are located in different files, hence it needs the executable code of those routines/functions. Linker is a tool which performs this job, it checks our program and includes all those routines or functions which we are using in our program to make a standalone executable code and this process is called Linking

Integrated Development Environment (IDE) It contains  Editor  Compilers  Debugger  Linkers  Loaders

Preprocessor program processes the code. Loader puts program in memory. CPU takes each instruction and executes it, possibly storing new data values as the program executes. Compiler creates object code and stores it on disk. Linker links the object code with the libraries Loader Primary Memory Compiler Editor Preprocessor Linker Primary Memory Disk CPU Disk Program is created in the editor and stored on disk.