Programming Languages Flashcards

1
Q

Assembly Language Characteristics

A

-One-to-one correspondence between machine instructions and assembly instructions
-Programmer must think like the machine
Inherently machine-dependent
-Converted to machine language by a program called an assembler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Third Generation Language

A

Uses high-level primitives
Similar to our pseudocode in Chapter 5
Machine independent (mostly)
Examples: FORTRAN, COBOL
Each primitive corresponds to a sequence of machine language instructions
Converted to machine language by a program called a compiler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Fourth Generation Language

A

There is no obvious difference between 3. and 4. generation PLs.
Programming process is short.
Spelled as “Fourth GL”. (“procedural language”).
Each step is defined and executed
Fourth GLs has own query languages.
SQL (structured query language)
SELECT address FROM staff WHERE name=“Ahmet”
Screen painter/designer,
Application generators
Report Generators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Local Global Variables Differences

A

Local Variable: is declared inside a specific function and can be accessed by the function in which its declared.
Global Variable: is one that declared outside of the functions in a program and can be accessed by any of the actions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Formal, Actual Parameters

A

Actual Parameters: are the values that are passed to a function when its called.
Formal Parameters: are the variable declared in the function header that are used to recieve the values of the actual parameters passed during the function call.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Pass by Value and Ref

A

-Pass by Value
*Makes a copy of actual parameter
*Changes made inside the function are not reflected in original value
*Requires more memory
*Requires more time(copying)
-Pass by Ref
-Mechanism of passing the actual parameters to the function
-changes made inside the function are reflected in the original value
-requires less memory
-requires a less amount of time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Program Design Aims

A

Reliability
Maintainability
Portability
Readability
Performance
Storage Saving

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Basic Coding Principles

A

Declarations: Long enough and meaningful descriptors should be used for program, subprogram, variables and constants.
Indentation: Indentations should be used in the program to reflect the structure of the program.
Structures: Appropriate program structures should be used.
Length: Subprograms in the program must be arranged in manageable lengths.
Descriptions: Descriptive information should be written into the program describing what has been done and what it is done for.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are translators?

A

Assembler: A program that transfers assembly language into machine code.
Compiler: A program that translates a high-level language into a machine-oriented language, often the machine code.
Interpreter: A program which translates and executes each source statement in logical sequence as the program is executed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The translation process

A

1-Source Program
2-Lexical analyzer
3-Parser
4-Code Generator
5-Object Program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Compiler and interpreter differences

A

1)Controls all program in one step.
Checks lexical and syntactical errors.
If no error is found, then the program is converted into object code.
The object code is converted to executable code
2)Checks all program statement by statement.
All statements in a loop are converted repeatedly.
Slow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is object and class

A

Object: Active program unit containing both data and procedures
Class: A template from which objects are constructed

An object is called an instance of the class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Components of an Object

A

Instance Variable: Variable within an object
Method: Procedure within an object
Constructor: Special method used to initialize a new object when it is first constructed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Encapsulation

A

Encapsulation: A way of restricting access to the internal components of an object
Private
Public

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

İnheritance

A

Inheritance: Allows new classes to be defined in terms of previously defined classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Polymorphism

A

Polymorphism: Allows method calls to be interpreted by the object that receives the call

17
Q

Parallel (or concurrent) processing

A

simultaneous execution of multiple processes
True concurrent processing requires multiple CPUs
Can be simulated using time-sharing with a single CPU

18
Q

Mutual Exclusion

A

Mutual Exclusion: A method for ensuring that data can be accessed by only one process at a time

19
Q

Monitor

A

Monitor: A data item augmented with the ability to control access to itself

20
Q

Resolution

A

Combining two or more statements to produce a new statement

21
Q

Resolvent:

A

A new statement deduced by resolution

22
Q

Clause form:

A

: A statement whose elementary components are connected by the Boolean operation OR

23
Q

Unification

A

Unification: Assigning a value to a variable so that two statements become “compatible.”