Introducing Programming a general discussion. What is a Program? Sets of instructions that get the computer to do something Programs may be a few lines.

Slides:



Advertisements
Similar presentations
compilers and interpreters
Advertisements

Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
Computers Are Your Future
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
Programming Creating programs that run on your PC
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
The Analytical Engine Module 6 Program Translation.
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
SOFTWARE SYSTEMS SOFTWARE APPLICATIONS SOFTWARE PROGRAMMING LANGUAGES.
Course: Introduction to Computers
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
Introduction to Programming End Show. Resource Team R.P Ranjan-Lecturer, SPICTEC, Galle. W.M.A.S. Wijesekara-Centre manager,CRC Hali-Ela H.P.U.S Indra.
Programming Languages Lecture 12. What is Programming?  The process of telling the computer what to do  Also known as coding.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Chapter-01 Introduction to Computers and C++ Programming.
Copyright ©2005  Department of Computer & Information Science Introducing Programming.
INTRODUCING COMPUTER SCIENCE CSCI N341: Client-Side Programming.
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
High-level Languages.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
INTRODUCTION TO COMPUTING CHAPTER NO. 06. Compilers and Language Translation Introduction The Compilation Process Phase 1 – Lexical Analysis Phase 2 –
Introducing Computer Science & Algorithms. Goals By the end of this lecture you should … … understand Computer Science as the study of algorithms … understand.
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Programming 1 1. Introduction to object oriented programming and problem-solving.
AS Computing Introduction to Programming. What is a Computer Program? A list of instructions that a computer must work through, in a logical sequence,
CS101 Introduction to Computing Lecture Programming Languages.
Programming Languages 1.07a.  A computer program is a series of instructions that direct a computer to perform a certain task.  A programming language.
Programming With C.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
Copyright © Prentice Hall Programming and Languages Chapter 14 Telling the Computer What to Do.
Software Development Programming & Languages. Programming: A Five-Step Procedure Define the problem Design a solution Code the program Test the program.
Chapter 1 Introduction. Chapter 1 -- Introduction2  Def: Compiler --  a program that translates a program written in a language like Pascal, C, PL/I,
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
CSC1200 INTRODUCTION TO PROGRAMMING Dr. Maureen Markel
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
Programming and Languages Dept. of Computer and Information Science IUPUI.
The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.
Compilers and Interpreters
Skill Area 311 Part B. Lecture Overview Assembly Code Assembler Format of Assembly Code Advantages Assembly Code Disadvantages Assembly Code High-Level.
The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Chapter 1: Introduction to Computers and Programming.
 By the end of this lecture, you should …  Understand the three pillars of Object- Oriented Programming: Inheritance, Encapsulation and Polymorphism.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Software Engineering Algorithms, Compilers, & Lifecycle.
Computer Software 1.
Programming Language Basics. What is a Programming Language? “A computer, human-created language used to write instructions for a computer.” “An artificial.
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Computer Systems Nat 5 Computing Science
CSC235 Computer Organization & Assembly Language
CMIT100 Chapter 14 - Programming.
CSCI-235 Micro-Computer Applications
Computer Programming.
Computer Systems Nat 5 Computing Science
High Level Programming Languages
CS105 Introduction to Computer Concepts Intro to programming
Programming Language Basics
PROGRAMMING FUNDAMENTALS Lecture # 03. Programming Language A Programming language used to write computer programs. Its mean of communication between.
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
1.3.7 High- and low-level languages and their translators
Presentation transcript:

Introducing Programming a general discussion

What is a Program? Sets of instructions that get the computer to do something Programs may be a few lines or millions of lines of code All instructions are translated, eventually, to machine language. Ada, Countess of Lovelace First computer Programmer

Programming Tasks Most programs can be though of as having three phases 1. To gather input data or generate it. 2. To manipulate that data aka process the data. 3. To give meaningful information back to the user (output). The MAS programs we just programmed did the above. The values defined at the end of the program were the data items that we gathered.

Families of Languages 1. Machine Languages This was the HEX code we saw in memory. All languages must be translated to this. This language is DIFFERENT for every distinct processor. 2. Assembly Languages This was the MAS code we wrote. This language matches the Machine language of the processor. 3. High Level Languages: Procedural Languages Object Oriented Languages

Machine Languages Machine language commands are comprised of words of binary values. In our case we had 16 bit words. Each word contained an instruction or data or junk. We wrote this language in HEX in order to save space. Machine language is normally thought of as the Native language of the particular processor. Different processor types have different machine languages. Although the Marie machine is imaginary even it has it own machine language ( i.e. the 15 instructions we used)

Assembly Languages Assembly language was invented to make programming in machine easier. Each machine language instruction has an assemble language counterpart. Every time we assembled the Assembly language (MAS) we generated machine (MEX). Requires an Assembler to do this translation. MASMEX Assembler

High Level Languages High level language commands are very close, in syntax, to English, thus resulting in comparatively low error rate. High level commands need to be translated to machine language using an interpreter or compiler

There are many HLL’s Popular Today C C++ Perl Visual Basic Python Java HTML And many others

Translation Using an Interpreter Interpreters translate code into machine language on a line-by-line basis. Examples include Perl, Python et Typically, the translation speed is comparatively quicker than a compiler, but the execution speed is slower. These languages are somewhat easier to program in that compiled languages. We will study Perl as an example. print “ This is your first program”; $A = 10; $Sum = $Sum + 1;

Translation Using a Compiler Compiler translate code into machine language by translating the entire program at once. Typically, the translation speed is comparatively slower than an interpreter, but the execution speed is much quicker. Examples include C, C++, Fortran, and Cobol cout<< “This is your first c++ program”; a = 19; a = a + 1; If (a>20) cout <<“ done”;

Common Operations All types of high level languages share three families of operations: 1. Sequential Operations 2. Conditional Operations 3. Looping Operations

High Level Langauges High level languages are designed to make it easier for humans to program computers. They use many language constructs that are well known in our Human languages such as English

Sequential Operations Sequential operations are lines of code that execute in order. Sequential operations are the default operations in programming. Each instruction in a sequential block is executed one after another. cout<< “This is your first c++ program”; a = 19; a = a + 1; cout << “This is the value of a:” << a << endl;

Conditional Operations Conditional operations (sometimes called decision structures) alter the course of a program based on the result of a TRUE/FALSE test. Programmers construct those tests using relational operators. This are usually what we call If-Then-Else constructions and look something like… if ( comparision) { do some instructions } else { do some different instructions }

Looping Operations Looping operations are those structures in which code repeats until a given condition is met. Similar to conditional operations, programmers construct looping operations using relational operators. Remember or loops in MAS. We had to use the complicated skipcond instruction. HLL’s make this much easier. while (x < 10) { do some instructions }

Procedural Languages Early high-level languages were procedural in nature. The focus of procedural languages was on structure. Examples include QuickBasic, Fortran, Pascal, and early versions of Visual Basic.

Object-Oriented Languages Object-oriented languages are a more recent development, where the focus is on data (the “Primacy of Data”). In OOP, programmers include data and the ways to manipulate that data into one entity – the object. Examples include Java,C++, C# and VB.NET.

Summary A program is a set of instructions to get your computer to do something. All programs have three basic types of instructions: (1) input instructions; (2) processing instructions and (3) output instructions.

Summary Machine languages are comprised of 1s and 0s and are the native languages of computers. Assembly language commands are tied to specific processors and represent shortcuts to machine language.

Summary High level languages are close, in syntax, to English. To translate high-level languages, we must use compilers or interpreters. All high-level languages share three basic groups of operations: sequential, conditional & looping.