CS 4337 Exam 1 Review

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/88

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

89 Terms

1
New cards

False

An advantage of using a compiler is that it generally produces portable code able to fun on many different hardware and software platforms.

2
New cards

block statement

What innovation introduced in ALGOL68 is often credited to Pascal?

3
New cards

False

Most programming languages are implemented as interpreters these days.

4
New cards

Easy development

From the point of view of the programmer what are the major advantages of using a high-level language rather than internal machine code or assembler language?

5
New cards

True

Python is interpreted.

6
New cards

Encapsulation, Inheritance, Polymorphism

Which of the following mechanisms is/are provided by Object Oriented Language to implement Object Oriented Model?

7
New cards

Reduce complexity

Which of the following is the functionality of 'Data Abstraction'?

8
New cards

Algol

Which PL is considered an ancestor to C, Java, and Ruby?

9
New cards

Logic Programming

Prolog comes under ___________

10
New cards

functional-oriented

Scala is part of the: ____?

11
New cards

True

The "Von Neumann" computer architecture is characterized by hardware that has a CPU separate from memory, which is used to hold both data and programs.

12
New cards

FORTRAN

Programming language which is used for scientific purposes in batches is

13
New cards

Byte code

_______________ is the assembly language for an imaginary architecture.

14
New cards

False

Markup languages are general purpose programming languages.

15
New cards

List Processing

Lisp is the second oldest high level programming language. Here Lisp stands for

16
New cards

add comments to it

To made program more easier to understand, programmers can

17
New cards

False

C has strong type-checking

18
New cards

C

The ________________ programming language is an example of a compiled language.

19
New cards

True

All phases of a compiler use a symbol table.

20
New cards

False

One of the advantages of interpreted languages is their faster execution time compared to compiled languages.

21
New cards

hierarchical

Which following term(s) is not a PL programming paradigm?

22
New cards

machine language, different for every type of CPU

What is the only language that a computer understands directly?

23
New cards

interpreter

A program which interprets each line of high level program at time of execution is called

24
New cards

True

Java uses a hybrid approach of compiling and interpreting.

25
New cards

assembly code into machine code

An assembler translates

26
New cards

machine language, assembly language, high level language

What are the three main types of computer programming languages?

27
New cards

Easy development

From the point of view of the programmer what are the major advantages of using ahigh-level language rather than internal machine code or assembler language?

28
New cards

Syntax

Programming languages have __________ , just like natural languages.

29
New cards

False

JavaScript is the same language as Java.

30
New cards

Scalable language

Scala is short form of

31
New cards

LISP

What programming language is used for artificial intelligence?

32
New cards

C

What programming language is used for system programming?

33
New cards

Java

What programming language is used for internet programming?

34
New cards

Fortran

What PL is used for scientific applications?

35
New cards

Cobol

What PL is used for business applications?

36
New cards

False

Machine code includes English words for basic computer commands.

37
New cards

True

Pascal became the most widely used introductory language

38
New cards

True

A strongly typed programming language is one that detects all type errors either at compile time or a run time.

39
New cards

Assembly

Which of the following is not a high level programming language?

40
New cards

To enable the program to be run on multiple platforms.

Which of the following is not an advantage of using a low level language?

41
New cards

interpreter

Program used for interactive computing is

42
New cards

False

In an abstract data type, the data representation of the type is the focus.

43
New cards

top-down parsing

When the parser starts constructing the parse tree from the start symbol and then tries to transform the start symbol to the input, it is called?

44
New cards

True

Denotational semantics is based on recursive function theory.

45
New cards

Denotational semantics

The most rigorous and most widely known formal method for describing the meaning of programs?

46
New cards

True

An actual_type is a synthesized attribute that stores the actual type of a variable or expression.

47
New cards

True

Synthesized attributes are used to pass semantic information up a parse tree.

48
New cards

the value of i in s

VARMP(i, s) produces?

49
New cards

False

An expected_type is a synthesized attribute associated with non-terminal that stores the expected type of an expression.

50
New cards

specify the static semantics of a programming language

Attribute grammars are used to

51
New cards

False

The lexical structure of complex programming languages like Java can not be defined using BNF

52
New cards

EBNF vs BNF

Not more powerful, but its rules are often simpler and clearer

53
New cards

right

Given the following BNF grammar for a language with two infix operators represented by # and $.

$ → ( ) # → x | y

What is the associativity of the $ operator:

54
New cards

True

If the grammar for a language is unambiguous, then there is only one way to parse each valid sentence in that language.

55
New cards

Components of a grammar

Productions, non-terminal symbols, terminal symbols, and a start symbol that must be a non-terminal.

56
New cards

Symbol Table

Which of the following is the name of the data structure in a compiler that is responsible for managing information about variables and their attributes? Choose ONE.

57
New cards

False

An operator's precedence determines whether it associates to the left or right.

58
New cards

The Dangling Else

Unable to determine with which 'if' the following 'else' associates

59
New cards

True

A recursive descent parser can not directly use a grammar that has left recursive rules.

60
New cards

{ }

EBNF for a series of zero or more; iteration

61
New cards

#

Given the following BNF grammar for a language with two infix operators,

$ → ( ) # → x | y

Which operator has higher precedence:

62
New cards

Derivation

The outcome of replacing a non-terminal by the right-hand side of one of its productions

63
New cards

False

The EBNF notation allows one to define grammars that can not be defined using the simpler BNF notation.

64
New cards

left

Given the following BNF grammar for a language with two infix operators represented by # and $.

$ → ( ) # → x | y

What is the associativity of the # operator:

65
New cards

The form of a language. A precise description of all the grammatically correct programs in a programming language.

Syntax

66
New cards

Represent the alphabet of the language being defined

Terminal symbol

67
New cards

-> | | ε -> 0 | 1

Which one of these grammars can produce the string 1010?

where ε is the empty string.

68
New cards

Lexer

Which program groups characters in code into tokens in a compiler?

69
New cards

Syntax analysis

In which phase in compiler design do we check the grammar of the programming language?

70
New cards

Formal Logic

On what branch of mathematics is axiomatic semantics based?

71
New cards

Preconditions and Postconditions

In Axiomatic semantics, the meaning of a specific statement is defined by:

72
New cards

Denotational semantics

__________ is based on recursive function theory.

73
New cards

Terminals.

In a parse tree, what do leaf nodes indicate?

74
New cards

Java

Which of the following programming languages is not susceptible to a stack-based buffer overflow attack?

75
New cards

On the stack before the return pointer,

On the stack after the return pointer,

In the stack frame of another function,

On the heap

Where can an attacker who is trying to "smash the stack" put their attack code if the buffer to be overflowed is on the stack? (5)

76
New cards

Pointer arithmetic

Which kinds of operations are most likely to lead to buffer overflows in C?

77
New cards

True

A "strong type system" is described as one in which there is no possibility of an unchecked run-time type error. In other words, the absence of unchecked run time errors is referred to as safety or type safety.

78
New cards

Whatever is in the memory space that comes after the buffer is overwritten

What typically happens when a buffer is overflowed?

79
New cards

Python

Which one of the following languages supports dynamic type binding?

80
New cards

Security-sensitive data,

A return pointer,

Any kind of pointer,

Anything that will make the program crash

What can be overwritten by a buffer overflow that causes a security problem?

81
New cards

the type system that guarantees not to generate type errors.

What is a strong type system?

82
New cards

boundary checks

Buffer-overflow may remain as a bug in apps if __________ are not done fully.

83
New cards

Only static type checking is done

For strongly-typed languages

84
New cards

C, C++

Applications developed by programming languages like ____ and ______ have this common buffer overflow error.

85
New cards

Whatever is at A[555] will be overwritten

If you declare an array as A[100] in C and you try to write data to A[555], what will happen?

86
New cards

int p = (int) malloc(50);

Which one of the following is an example of an explicit heap-dynamic variable?

87
New cards

dynamically

In an application that uses heap, the memory for data is allocated

88
New cards

True

Buffer-overflow attack can take place if a machine can execute a code that resides in the data/stack segment.

89
New cards

heap

Variables that get created dynamically when a function (such as malloc()) is called is created in the form of _______ data structure.