Programming For A2 Comp

273 views
252 views

Published on

This covers details on Writing Pascal using Lazarus.
A teaching resource for students who have covered the AS course (slides also available). Can be used for teaching or direct notes for students.
Originally written for AQA A level Computing (UK exam).

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
273
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Programming For A2 Comp

  1. 1. Programming for A2 Computing High Level Languages By David Halliday Module 4
  2. 2. High and Low Level languages <ul><li>High Level languages </li></ul><ul><li>Examples: </li></ul><ul><ul><li>C, C++ </li></ul></ul><ul><ul><li>Pascal </li></ul></ul><ul><ul><li>BASIC </li></ul></ul><ul><li>Portable (can be compiled on different systems) </li></ul><ul><li>Problem oriented (designed around solving different types of problem) </li></ul><ul><li>Statements resemble English language (formalised) </li></ul><ul><li>Low level Languages </li></ul><ul><li>Examples </li></ul><ul><ul><li>Assembly </li></ul></ul><ul><li>Machine Oriented: designed for individual machine or processor architectures </li></ul><ul><li>Each statement translates into one machine instruction </li></ul><ul><li>Statements resemble machine instructions in mnemonics </li></ul>
  3. 3. High Level Language Facilities <ul><li>Selection statements: </li></ul><ul><ul><li>If, Then, Else, Case </li></ul></ul><ul><li>Iteration (repetition) statements: </li></ul><ul><ul><li>While...EndWhile, Repeat...Until, For… EndFor </li></ul></ul><ul><li>Built in/Library routines, functions and enumerated data types to simplify I/O </li></ul><ul><ul><li>Readln, writeln </li></ul></ul><ul><ul><li>Sqr, log </li></ul></ul><ul><ul><li>String, Array, Record </li></ul></ul>
  4. 4. High Level Language Paradigms <ul><li>High level languages often fit into one of 3 categories </li></ul><ul><ul><li>Imperative (procedural) </li></ul></ul><ul><ul><ul><li>Imperative programs explicitly specify an algorithm to achieve a goal </li></ul></ul></ul><ul><ul><ul><li>Examples include: </li></ul></ul></ul><ul><ul><ul><ul><li>C, C++ </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Pascal </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Fortran </li></ul></ul></ul></ul><ul><ul><li>Declarative </li></ul></ul><ul><ul><ul><li>Declarative programs explicitly specify the goal and leave the implementation of the algorithm to the support software </li></ul></ul></ul><ul><ul><ul><li>Examples include: </li></ul></ul></ul><ul><ul><ul><ul><li>Prolog </li></ul></ul></ul></ul><ul><ul><li>Functional </li></ul></ul><ul><ul><ul><li>Emphasizes the application of functions, unlike imperative programming, which emphasizes changes in state and the execution of sequential commands. </li></ul></ul></ul><ul><ul><ul><li>Examples include: </li></ul></ul></ul><ul><ul><ul><ul><li>Haskell </li></ul></ul></ul></ul>
  5. 5. Imperative (procedural) Languages <ul><li>Imperative programs explicitly specify an algorithm to achieve a goal </li></ul><ul><li>They are concerned with changing of states of variables in memory </li></ul><ul><li>The closest paradigm to assembly/machine code </li></ul><ul><li>Problem Oriented… They are developed to solve particular types of problem: </li></ul><ul><ul><li>FORTRAN (FORmula TRANslation) </li></ul></ul><ul><ul><ul><li>dev'd in 1950s for use in scientific and engineering </li></ul></ul></ul><ul><ul><li>COBOL (COmmon Business Oriented Language) </li></ul></ul><ul><ul><ul><li>dev'd in 1950s for data processing (first to use records) </li></ul></ul></ul><ul><ul><li>'C‘ </li></ul></ul><ul><ul><ul><li>developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. </li></ul></ul></ul><ul><ul><li>Pascal </li></ul></ul><ul><ul><ul><li>dev'd in 1970s to teach structured programming </li></ul></ul></ul><ul><ul><ul><li>Extended by Boreland with Delphi making a useful RAD tool </li></ul></ul></ul>
  6. 6. Embedded systems <ul><li>Computer is component in a larger system. </li></ul><ul><li>Examples include: </li></ul><ul><ul><li>microprocessor-controlled washing machine or video recorder; </li></ul></ul><ul><ul><li>a modern jet aircraft; </li></ul></ul><ul><ul><li>a system for controlling traffic lights; </li></ul></ul><ul><ul><li>a process control system for controlling the flow of water along a pipe by means of a valve; </li></ul></ul><ul><ul><li>a robot used in a car assembly plant. </li></ul></ul><ul><ul><li>Modern mobile phones </li></ul></ul>
  7. 7. Criteria for Selecting a Language <ul><li>The nature of the application; </li></ul><ul><li>The availability of facilities within the language for implementing the software design; </li></ul><ul><li>The availability of a suitable compiler/interpreter for the hardware; </li></ul><ul><li>The expertise of the programmers. </li></ul>
  8. 8. Homework <ul><li>Heathcote Chapter 35 Page 219 All Questions </li></ul>

×