Search Header Logo
Lecture 1 - part 2 - CIS430

Lecture 1 - part 2 - CIS430

Assessment

Presentation

Computers

University

Practice Problem

Medium

Created by

Sherif Abdelhamid

Used 2+ times

FREE Resource

6 Slides • 4 Questions

1

media
media

ISBN 0-321-49362-1

Chapter 1

Preliminaries

2

media

Copyright © 2015 Pearson. All rights reserved.

1-2

Chapter 1 Topics

Reasons for Studying Concepts of
Programming Languages

Programming Domains

Language Evaluation Criteria

Influences on Language Design

Language Categories

Language Design Trade-Offs

Implementation Methods

Programming Environments

3

media

Copyright © 2015 Pearson. All rights reserved.

1-3

Language Categories

Imperative
– Central features are variables, assignment statements, and

iteration

– Include languages that support object-oriented programming
– Include scripting languages
– Include the visual languages
– Examples: Python, C, Java, Perl, JavaScript, Visual BASIC .NET,

C++

Functional
– Main means of making computations is by applying functions to

given parameters

– Examples: LISP, Scheme, ML, F#

Logic
– Rule-based (rules are specified in no particular order)
– Example: Prolog

Markup
– A set of rules that defines how the layout and presentation of

text and images should appear in a digital document.

– Examples: XML, HTML, LaTeX, MathML, JSON

4

Multiple Choice

XML stands for?

1

Hypertext Markup Language

2

Extensible Machine Language

3

Extensible Markup Language

4

None of these

5

media

Copyright © 2015 Pearson. All rights reserved.

1-4

Language Design Trade-Offs

• Reliability vs. cost of execution

– Example: Java demands all references to array elements

be checked for proper indexing, which leads to increased
execution costs

• Readability vs. writability

Example: APL provides many powerful operators (and a large

number of new symbols), allowing complex computations
to be written in a compact program but at the cost of poor
readability

n ← 4 5 6 7

n+4

8 9 10 11

• Writability (flexibility) vs. reliability

– Example: C++ pointers are powerful and very flexible but

are unreliable

6

Multiple Choice

LISP belongs to which programming language category?

1

Imperative

2

Functional

3

Markup

4

Logic

7

media
media
media

APL - Readability vs. writability

1-5

8

media
media
media

APL - Readability vs. writability

VAR

sum,ARRAY data[1..500] OF REAL

i INTEGER;

BEGIN

WRITE('Number of data=..');

READLN(n);

sum:=0;

FOR i:=1 TO n DO

BEGIN

READ(data[i]);

sum:=sum+data[i]

END;

WRITELN(sum);

END.

but in APL you simply program the sum of inputs (no need for loops) as: ,

and the mean is also very tersely formulated as:

1-6

(+/X)÷X

9

Multiple Choice

It is easier to be an expert in APL compared to Pascal?

1

True

2

False

10

Multiple Choice

If x is an array in APL, then ⍴X means?

1

Sum of the elements in array x

2

Number of the elements in array x

3

Average of the elements in array x

4

Product of the elements in array x

media
media

ISBN 0-321-49362-1

Chapter 1

Preliminaries

Show answer

Auto Play

Slide 1 / 10

SLIDE