PROGRAMMING FUNDAMENTALS Lecture # 03. Programming Language A Programming language used to write computer programs. Its mean of communication between.

Slides:



Advertisements
Similar presentations
Programming Types of Testing.
Advertisements

Program Development and Programming Languages
Compilers and Interpreters. Translation to machine language Every high level language needs to be translated to machine code There are different ways.
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
CC111 Lec#5: Program Development 1 Program Development and Programming Languages Lecture 4 Reference :Understanding Computers Chapter 13.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Designing and Debugging Batch and Interactive COBOL Programs Chapter 5.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 October 20, October 20, 2015October 20, 2015October 20,
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
Errors “Computer says no..”. Types of Errors Many different types of errors new ones are being invented every day by industrious programming students..
Evolution and History of Programming Languages 1.
What is Programming? A program is a list of instructions that is executed by a computer to accomplish a particular task. Creating those instructions is.
1 Program Planning and Design Important stages before actual program is written.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Programming and Languages Dept. of Computer and Information Science IUPUI.
Principles of Programming CSEB134 : BS/ CHAPTER Fundamentals of the C Programming Language.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Compilers and Interpreters
Introduction to Computer Programming using Fortran 77.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Software Engineering Algorithms, Compilers, & Lifecycle.
by sir fakhri alam programing fundamental
Evolution and History of Programming Languages
Chapter 1 Introduction 2nd Semester H
Software Development Environment
Why don’t programmers have to program in machine code?
Lecture 1b- Introduction
Advanced Computer Systems
Component 1.6.
Assembler, Compiler, MIPS simulator
Visit for more Learning Resources
Programming Languages
Definition CASE tools are software systems that are intended to provide automated support for routine activities in the software process such as editing.
CSC201: Computer Programming
Introduction to programming
Operating System Interface between a user and the computer hardware
Lecture 1 Introduction Richard Gesick.
CSCI-235 Micro-Computer Applications
Computer Programming.
A451 Theory – 7 Programming 7A, B - Algorithms.
TRANSLATORS AND IDEs Key Revision Points.
Assembler, Compiler, Interpreter
Designing and Debugging Batch and Interactive COBOL Programs
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
CS105 Introduction to Computer Concepts Intro to programming
Programming.
Programming Fundamentals Lecture #3 Overview of Computer Programming
Assembler, Compiler, Interpreter
Programming Language Basics
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
ICT Programming Lesson 1:
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
Understand the interaction between computer hardware and software
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
General Computer Science for Engineers CISC 106 Lecture 03
An Overview of C.
1.3.7 High- and low-level languages and their translators
Programming language translators
CS105 Introduction to Computer Concepts Intro to programming
CHAPTER 6 Testing and Debugging.
Presentation transcript:

PROGRAMMING FUNDAMENTALS Lecture # 03

Programming Language A Programming language used to write computer programs. Its mean of communication between user and the computer. There are two categories to Computer Programming Language 1.High Level Language 2.Low Level Language COMPUTER LANGUAGES

Low Level Language A low level programming language is a programming language that provides little or no abstraction from a computer’s instruction set architecture. It consists of numeric codes i-e 0 &1. These codes are easily understandable to computer but difficult to human. A low level language is used in two generations of computer. 1.First generation 2.Second Generation LOW LEVEL LANGUAGE

Represent the very early, primitive computer language that consisted entirely of 1’s and 0’s – the actual language that the computer understands (machine language). FIRST GENERATION LANGUAGE OR 1GL

Represent a step up from the first generation languages. Allow for the use of symbolic names instead of just numbers. Second generation languages are known as assembly languages. Code written in an assembly language is converted into machine language (1GL). SECOND GENERATION LANGUAGE OR 2GL

A Type of language that is close to human languages is called high level language. High level languages are easy to understand. Instructions o these languages are written in English-like words such as input and print etc. Examples: Cobol Java C/C++ Visual Basic HIGH LEVEL LANGUAGE OR 3GL

Source Code A program written in a high level language is called source code / source program. The source code cannot be executed by computer directly. It is converted into object code and then executed. Object Code A program in machine language is called object code / object program / machine code. Computer understands object code directly. SOURCE AND OBJECT CODE

Language Translators Convert Programming source code into language that the computer processor understands. Programming source code has various structures and commands, but the computer processors understand only machine language. Language translators are of three types:- 1.Compiler 2.Interpreter 3.Assembler LANGUAGE TRANSLATORS

Scans the entire program and translates it as a whole into machine code. It takes large amount of time to analyze the source code but the overall execution time is comparatively faster. It generates the error message only after scanning the whole program. Hence debugging is comparatively hard. Programming language like C, C++ use compilers. COMPILER

Translates program one statement at a time. It takes less amount of time to analyze the source code but the overall execution time is slower. Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy. Programming language like Python, Ruby use interpreters. INTERPRETER

An assembler is a program that converts assembly language into machine code. It takes the basic commands and operations from assembly code and converts them into binary code that can be recognized by a specific type of processor. ASSEMBLER

SYNTAX ERROR Errors that occur when you violate the rules of writing C/C++ syntax are known as syntax errors. This compiler error indicates something that must be fixed before the code can be compiled. All these errors are detected by compiler and thus are known as compile-time errors

SYNTAX ERROR Example #include void main() { printf(“Hello Pakistan”) }

SYNTAX ERROR Example #include void main() { printf(“Hello Pakistan”)// semi-colon missed }

On compilation and execution of a program, desired output is not obtained when certain input values are given. These types of errors which provide incorrect output but appears to be error free are called logical errors. These are one of the most common errors done by beginners of programming. LOGICAL ERROR

Example #include void main() { int i; for(i=0;i<3;i++); printf(“Loop”); getch(); } LOGICAL ERROR

Example #include void main() { int i; for(i=0;i<3;i++); // logical error : a semicolon after loop printf(“Loop”); getch(); } LOGICAL ERROR

Errors which occur during program execution(run-time) after successful compilation are called run-time errors. One of the most common run-time error is division by zero also known as Division error. These types of error are hard to find as the compiler doesn’t point to the line at which the error occurs. RUN TIME ERROR

Example #include void main() { int i = 10; int ans; ans = i / 0; printf(“ Result = %d”, ans); getch(); } RUN TIME ERROR

Example #include void main() { int i = 10; int ans; ans = i / 0; printf(“ Result = %d”, ans); getch(); } RUN TIME ERROR Wrong logic Number divided by zero So this program abnormally terminates.

What are linker and loader??

Thank You