Languages_high_low_ObjectOrientated_Introduction

Views:
 
Category: Entertainment
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Intro to-Low Level, High Level Languages-and Object Orientated Programming : 

Intro to-Low Level, High Level Languages-and Object Orientated Programming Topics include: -High and Low Level Languages -High level language facilities -Procedural (imperative languages) -Declarative Languages -Languages for ‘real time’ embedded systems -History of OOP -Objects and Classes -Pascal Examples -Encapsulation -Inheritance -Polymorphism -Containment -Event Driven Programming -Benefits of OO Programming

A2 Computing –Module 4 (JAN 23) : 

A2 Computing –Module 4 (JAN 23) Number Bases and Representation Binary, OCTAL, HEX Binary Arithmetic Two’s Complement system, negative number representation Interrupts Floating Point Numbers and Normalisation Structure and Role of the Processor Fetch Execute Cycle Structure and Role of the Registers Assembly language instructions Instruction formats and addressing modes (INDRECT, BASE, INDEXED ETC) Low Level Languages High Level Languages & Intro to OO Object Orientated Programming Prolog Programming Recursion Lists/Linked Lists Stacks Queues Trees Searching and Sorting Operating Systems and Concepts Memory/File/I/O Management

Types of Languages : 

Types of Languages HIGH LOW Example: Assembly language Examples: Pascal, Basic, Prolog or C

Types of Languages : 

Types of Languages HIGH LOW Example: Assembly language Examples: Pascal, Basic, Prolog or C Closer to what The computer understands (low) High (because we are superior to computer) Closer to What we understand (resembling English Statements)

Characteristics of a Low Level Language : 

Characteristics of a Low Level Language Machine orientated Program written for one machine will work on any other type of machine (with different processor chip) Assembly language statement (apart from macros) translates into one machine code instruction. Programming is therefore quick, non-time consuming and efficient Assembly language used when you need to access machine registers or exact memory adresses Or when you need to write code that executes as fast as possible Occupies as little memory as possible An example with all the above three requirements is a device driver (program which allows computer to interface with printer) F F F=False. Which statement's) are false?

Characteristics of a high level language : 

Characteristics of a high level language Not machine orientated In theory –are portable –program written for one machine can run anywhere else (provided compiler, interpreter available) Problem orientated –HLL’s have features and structures that are appropriate to a particular problem. Generally resemble English sentences or maths expressions Easier to understand than assembly language (low level) instructions Each statement in a high level language is translated into one machine code instruction F* *Into many machine code instructions (as opposed to Low level instructions)

Typical High Level Language facilities : 

Typical High Level Language facilities 1. SELECTION STRUCTURE 2. ITERATION STRUCTURES 3. BUILT-IN-ROUTINES to simplify input/output 4. BUILT-IN-FUNCTIONS 5. DATA STRUCTURES These are not found in low level languages If…then….else…case; While…endwhile, repeat…until…for Endfor. ASSEMBLY lang must used conditional Branch statements (branch if equal to, etc) Readln, writeln (PASCAL) Sqr, log, chr; String, array, Record

Types of High Level Languages : 

Types of High Level Languages

True or false : 

True or false Declarative languages (like DELPHI) are in which the program consists of a sequence of instructions. False Declarative –about rules and facts about a subject rather Than sequence of instructions (eg. PROLOG)

Languages for real-time embedded systems : 

Languages for real-time embedded systems Computers have become smaller, faster, better, etc. so their applications has widened. One huge area of computer apps is EMBEDDED SYSTEMS EMBEDDED SYSTEM –the computer is just ONE part of a larger engineering system

Examples of Embedded System : 

Examples of Embedded System

Slide 12: 

Old video recorder/player

Process control system forcontrolling traffic lights : 

Process control system forcontrolling traffic lights

Car assembly robot : 

Car assembly robot

US AIR FORCE C-17 transport aircraft has 19 different embedded computers with 80+ microprocessors on board. : 

US AIR FORCE C-17 transport aircraft has 19 different embedded computers with 80+ microprocessors on board.

Languages for programming REAL TIME systems need the following facilities : 

Languages for programming REAL TIME systems need the following facilities Real time control facilities (programmers should be able to specify times at which actions are performed, or set regular intervals –i.e every 5 seconds. Electric power station needs to increase supply at 5PM. Traffic lights may change every 30 seconds or less if oncoming car detected) Ability to act and recognise on the non-occurrence of some external event (temperature sensor in a nuclear reactor to log every second. Failure to log after 10 seconds to be reported as a fault) Should be able to have a timeout facility (programmer can code a time-out facility. i.e what happens when the 10 seconds are up) Interaction with hardware interfaces (sensor detection etc) Ability to support concurrent programming (more than one action carried out simultaneously) (languages like C, ADA, Modula-2, OCCAM all contain these facilities)

Slide 19: 

Structured Programming? This approach involves decomposing a large problem into smaller problems until the smaller problems become solvable.

In structured programming : 

In structured programming Smaller problems are coded as Procedures or Functions Data passed to these using Parameters (Procedural O P) The thing to remember is that DATA AND PROCEDURES remainTOGETHER. True or false?

FALSE! : 

FALSE! Structured Programming Procedural (imperative) Programming (Problems broken down into smaller tasks using procedures and functions and parameters passing data to the P’s an F’s) DATA AND PROCEDURES REMAIN SEPARATE!!

Object Orientated programming : 

Object Orientated programming The world is made up of objects So OOP models the real world more closely Objects store both data and code for the operations that may be applied to that data.

True or False : 

True or False Procedural (imperative) and Structural Languages have Data and Procedures that are contained together. False

True or false : 

True or false In an object orientated language like Visual Basic….objects store both data and code for the operations that may be applied to that data. True

Procedural Programming languages : 

Procedural Programming languages PASCAL? True

Some procedural languages : 

Some procedural languages Have OO features built in (Object Pascal) C++ was developed from C by adding OO capability Java =truly object orientated

So what makes something Object Orientated? : 

So what makes something Object Orientated? How do we decide if something is ALIVE? It must fit certain criteria, such as: -Breathing -Movement -Excretion -Growth -Sensitivity -Reproduction Criteria for being a living thing

Slide 28: 

-Inheritance -Encapsulation -Polymorphism *Abstraction *Containment Criteria for being an OO programming language OBJECTS represent real things from the real world. i.E A CAR. An Object also has ATTRIBUTES. The colour, the shape, the size of the car. These values (attributes) are stored in FIELDS THE CLASS defines what fields it has. The OBJECT stores its own set of values (the state of the object) Objects also have METHODS (operations) like update mileage (this Describes the objects BEHAVIOUR) Each class has SOURCE CODE associated with it –i.e this defines its Details (fields and methods)

Slide 29: 

Procedural(Imperative)

JAVA : 

JAVA

C++ : 

C++

C : 

C

Slide 33: 

Procedural(Imperative) Developed for use in scientific And engineering applications in the 1950’s Features that made it suitable For MATHEMATICAL applications -large library of maths functions like log, sin -comprehensive library of stats, scientific And engineering routines -double precision arithmetic (64 bits instead Of 32 bits to represent a real number) which means calculations are done with Greater accuracy -good array handling capabilities So suitable for solving large sets of Simultaneous equations

Common Business Orientated Language : 

Common Business Orientated Language Great for Data Processing Applications -good validation facilities -a sort verb to allow files to be sorted into Any sequence -excellent file-handling capabilities -good report-formatting features -facility to access database from cobol prog NEW VERSIONS OF COBOL are OO And have web-based features! Procedural(Imperative)

So how do we chose a Programming Language? : 

So how do we chose a Programming Language? What factors would you consider?

So how do we chose a Programming Language? : 

So how do we chose a Programming Language? Nature of the application Availability of facilities within the language for implementing the software design Availability of a suitable compiler/interpreter for the hardware The expertise of the programmer

authorStream Live Help