Machine Languages It is the only language the computer understands. It is made of 0s and 1s. They must be in 0s and 1s because the internal circuit of.

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

EC-111 Algorithms & Computing Lecture #1 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
Lecture 1: Overview of Computers & Programming
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Computers: Tools for an Information Age
Chapter 9: The Tower of Babel Invitation to Computer Science, C++ Version, Fourth Edition Additions by S. Steinfadt for SP08.
Chapter 1: An Overview of Computers and Programming Languages
Chapter 9: The Tower of Babel Invitation to Computer Science, Java Version, Third Edition.
Chapter 9: The Tower of Babel Invitation to Computer Science, C++ Version, Fourth Edition Editied / additions by S. Steinfadt for SP09.
Chapter 9: The Tower of Babel
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.
Chapter 8 The Tower of Babel. Chapter Outline Procedural languages Fortran, COBOL, PASCAL, C, Ada Object-oriented programming Special-purpose languages.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
CHAPTER 1: INTORDUCTION TO C LANGUAGE
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
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 
BIT Presentation 6. Contents GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES.
Programming Languages: Telling the Computers What to Do Chapter 16.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
Chapter 9: The Tower of Babel Invitation to Computer Science, C++ Version, Third Edition.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Hello World 2 What does all that mean?.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 1 – Car Payment Calculator and Guess the Number.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
CMPE13Cyrus Bazeghi 1 Programming Languages Telling computers what to do.
1.8History of Java Java –Based on C and C++ –Originally developed in early 1991 for intelligent consumer electronic devices Market did not develop, project.
Chapter 9 Programming Languages
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Introduction to Computers Outline 1.1Introduction.
Programming Fundamentals. Today’s Lecture Why do we need Object Oriented Language C++ and C Basics of a typical C++ Environment Basic Program Construction.
Course Title: Introduction to C++ Course Instructor: ADEEL ANJUM Chapter No: 01 1 BY ADEEL ANJUM (MCS, CCNA,WEB DEVELOPER)
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Chapter 1 Introduction.
Evolution and History of Programming Languages 1.
Chapter 9 Programming Languages. Have a vision of computer language evolution. Distinguish between machine, assembly, and high-level languages. Understand.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
Invitation to Computer Science 5th Edition
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
JavaScript Defined JavaScript Basics Definitions JavaScript is an object-oriented programming language designed for the world wide web. JavaScript code.
Agenda Computer Languages How to Write a Simple C Program
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Chapter 9 ProgrammingLanguages.  Describe the evolution of programming languages from machine language to high-level languages.  Understand how a program.
Introduction to OOP CPS235: Introduction.
Course Instructor: Hira Farman Course : BY:HIRA FARMAN.
Course Title Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
CHAPTER 1.1 INTRODUCTION TO COMPUTERS AND C++ Dr. Shady Yehia Elmashad.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
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.
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.
Introduction to computer programming
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Computer Languages [Computing] Computing.
Ashima Wadhwa Assistant Professor(giBS)
Visit for more Learning Resources
Chapter 1: An Overview of Computers and Programming Languages
CSCI-235 Micro-Computer Applications
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Introduction to Computer Programming
Introduction to Computer Programming
Principles of Programming Languages
Presentation transcript:

Machine Languages It is the only language the computer understands. It is made of 0s and 1s. They must be in 0s and 1s because the internal circuit of a computer is made up of switches, transistors, and other electronic devices that can be either on or off (1 or 0 respectively). Example of Machine Language: (on page167)

Symbolic Languages Developed by Grace Hopper, a mathematician for US Navy in 1950s It uses symbols or mnemonics to represent machine language A program called an assembler is used to translate symbolic code into machine language They’re also known as assembly languages because they have to be assembled

Symbolic Languages Cont’d. Example: multiplication program page entry main, ^m 2 sub12 #12, sp 3 jsb C$MAIN_ARGS 4 movab $CHAR_STRING_CON 5 6 pushal -8(fp) 7 pusal (r2) 8 calls #2, read 9 pushal -12 (fp) 10 pushal 3 (r2) 11 calls #2, read 12 mull3 -8 (fp), -12 (fp), - 13pusha 6 (r2) 14 calls #2, print 15 clrlr0 16 ret

High-Level Languages Developed to improve programmer efficiency from symbolic languages & to change focus from the computer to the problem being solved They’re portable to different computers They still need to be converted to machine languages in a process called compilation Examples include: –BASIC –COBOL –Pascal –Ada –C

Natural Languages These include the language that people speak in their daily lives These can include: –English –Spanish –German –French –Italian The idea is to use one’s natural language to give the computer orders This has only limited use today

Building a Program 1.Writing and Editing Programs: Use a text Editor to write programs When you’re done you save your program to the disk (known as a source file) and it will be input to the compiler 2.Compiling Programs: Translates inf in a source file into machine language Made of 2 separate programs: the preprocessor & the translator Preprocessor: reads the source code and prepares it for the translator. While preparing the code it scans for special commands (preprocessor directives) that tell it to look for special code libraries, make substitution in the code, & other ways to prepare the code for translation into machine language. The result of this processing is called the translation unit. Translator: converts the translation unit into machine language. This code in machine language is called the object module 3.Linking Programs: A high-level language has many subprograms, some of which are written in the program & some exist elsewhere and have to be attached to the program (ex: I/O processes) The linker assembles all of these functions into the final executable function.

Program Execution Use the Operating System (OS) command (ex.: run) to load the program into primary memory & execute it. Loader: it is an OS program responsible for loading the program into the memory Program reads data for processing either from the user or from a file After the program processes the data it prepares the output to either the monitor or to a file When the program is finished it tells the OS, which removes the program from memory

Categories of Languages

Procedural (Imperative) Languages Procedural Language: a set of instructions that are executed one-by-one from beginning to end unless an instruction forces the control elsewhere Each instruction either manipulates data items or is a control execution. Examples: –FORTRAN –COBOL –Pascal –C –Ada

FORTRAN FORmula TRANslation Designed by a group of IBM engineers & was commercially available in 1957 First high-level language Features: –High-precision arithmetic –Capability of handling complex numbers –Exponentiation computation (a b )

COBOL COmmon Business-Oriented Language Designed by US Navy computer scientists Designed to be used as a business programming language Fast access to files and databases Fast updating of files and databases Large amounts of generated reports User-friendly formatted output

Pascal Invented by Nikalus Wirth in 1971 in Zurich, Switzerland Named after Blaise Pascal, the 17th century French mathematician & philosopher who invented the Pascaline calculator Designed to teach programming to novices by emphasizing the structured programming approach

C & Ada C language developed by Dennis Ritchie at Bell Laboratories Originally designed for writing Operating Systems Later became popular among programmers Ada was named after Augusta Ada Byron, the daughter of Lord Byron & the assistant to Charles Babbage Created by US Department of Defense to be a uniform language used by all Department of Defense contractors

Object-Oriented Languages The objects (a data item) & the operations to be applied to them are tied together Programmer first defines and object & the types of operations that can be applied to this object & can use this combination & invokes some or all of the operations defined to solve a problem The objects are active Example: –C++ –Java

C++ Developed by Bjarne Stroustrup at Bell Laboratories Uses classes to define general characteristics of similar objects & the operations that can be applied to them 3 principles: encapsulation, inheritance, polymorphism Encapsulation: the idea of hiding the data & some operations that can be performed on the data inside the object Inheritance: an object can inherit from another object Polymorphism: you can define several operations with the same name that can do different things in related classes

Java Developed by Sun Microsystems, Inc. Based on C & C++ It’s totally class oriented Program can be either an application or an applet Application: stand-alone program Applet: embedded in HTM language, stored on a server, & run by a browser Class Library: a collection of classes Multithreading: a thread is a sequence of actions executed one after the other, Java allows for multithreading

Functional Languages A program is considered a mathematical function A function is a black box that maps a list of inputs to a list of outputs It does the following: –It predefines a set of primitive (atomic) functions that can be used by any programmer –It allows the programmer to combine primitive functions to create new functions Advantages over procedural language: –It encourages modular programming –Allows the programmer to make new functions our of existing ones Examples: –LISP –Scheme

LISP & Scheme LISt Programming Designed by researchers at MIT in the early 1960s Everything is considered a list Scheme Version of LISP developed by MIT in 1970s Defines a set of primitive functions that solves problems

Declarative (Logic) Languages Uses the principle of logical reasoning to answer queries Based on formal logic defined by Greek mathematicians & later developed into what is called first-order predicate calculus Logical reason is based on deduction One problem: a program is specific to a particular domain because collecting all the facts into one programming makes it huge Example: –Prolog

Prolog PROgramming in LOGic Developed by A. Colmerauer in France in 1972 Program is made of facts and rules

Special Languages HTML PERL SQL

HTML Hypertext Markup Language Pseudolanguage that includes marks that serve as formatting hints & links & tags HTML file is made of texts & tags Tag:enclosed in 2 angle brackets & usually come in pairs; marks that are embedded into the text; it can have a list of attributes, each of which can be followed by an equal sign & value associated with the attribute HTML file (page) is stored on the server & can be downloaded by a browser Browser removes the tags & interprets them as either formatting hints or links to other files Allows you to embed formatting instructions in the file itself & are stored in the text 2 parts: –Head: the first part that contains the title of the page & other parameters that the browser will used –Body: the actual contents of a page; includes the text & tags; text is the actual info contained in a page; tags define the appearance of the page

HTML

PERL Practical Extraction & Report Language High-level language with a syntax similar to the C language but more efficient Its power is in its well-designed use of regular expressions that allow the programmer to parse a string of characters into its components & extract the needed info

SQL Structured Query Language Used to answer queries about databases

Overview Types of languages: –Machine, Symbolic, High-Level, Natural Building a program: –Writing & editing –Compiling –Linking Categories of Languages: –Procedural (ex: FORTRAN) –Object-Oriented (ex: C++) –Functional (ex: LISP) –Declarative (ex: Prolog) –Special (ex: HTML)