Chapter 1 Flashcards

(88 cards)

1
Q

What is a programming language?

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

What are the different levels of programming languages?

A

hardware > machine language > assembly language > high-level language

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

What is a programming paradigm?

A

basic assumptions, ways of thinking, or methodologies that are commonly accepted by members of a group or community

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

Give four examples of programming paradigms.

A

object-oriented, imperative, logic, and functional

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

How is a program written in machine language?

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

How are machine language instructions processed by the CPU?

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

Is it possible to have conditions and loops in code written in machine language?

A

no

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

How is a program written in assembly language different from a program written in machine language?

A

machine language is composed of 1’s and 0’s only
assembly language uses characters and numbers

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

Is code written in assembly language executed in sequential order?

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

What is needed to execute a program in assembly language?

A

an assembler

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

What is the function of an assembler?

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

What are the three elements that every single high-level programming language is able to handle?

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

All high-level programming languages require that a variable be defined with a specific data type. (T or F)

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

What is the function of a compiler?

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

Is the compiler the one running the program?

A

no

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

How did punch cards work? (bonus)

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

What are the registers in the CPU? How do they play a role in the execution of instructions in a computer? (bonus)

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

When a value is stored in a variable, what actually happens in the computer? Where is it stored and how does the computer refer to the place it is stored?

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

Are there languages that support more than one paradigm?

A

yes

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

Give two examples of object-oriented programming languages.

A

C++ and Java

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

What is the programming paradigm of Scheme?

A

functional?

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

What is the key idea of procedural programming?

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

What is the key idea of object-oriented programming?

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

What is the key idea of functional programming?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is the key idea of logic programming?
26
What are the main features of procedural programming?
27
What are the main features of object-oriented programming?
28
What are the main features of functional programming?
29
What are the main features of logic programming?
30
Inheritance is a feature of imperative programming. (T or F)
F
31
Instance variables are available in imperative programming. (T or F)
32
What is a language?
33
What is a high-level programming language?
34
What is a low-level programming language?
35
Is Java low-level or high-level?
high-level
36
What does object-oriented programming mean?
37
What is an operator?
38
What is a lexical rule?
39
What is a syntactic rule?
40
What is a semantic rule?
41
What is a lexical error?
42
What is a syntactical error?
43
Give an example of a lexical rule in Java.
44
Give an example of a syntactical rule in Java.
45
int $ = 1; Is this sentence correct on the lexical, syntactical, and semantics level in Java?
lexical = yes syntactical = semantics =
46
int x = 'a'; Is this sentence correct on the lexical, syntactical, and semantics level in Java?
lexical = yes syntactical = yes semantics = yes
47
for(;;); Is there a syntactical error in this sentence in Java?
no
48
Does a lexical error cause a syntactical error?
49
Does a syntactical error cause a lexical error?
50
12938102&qwerty-1a1a1a/xyzw(;}"aaa999; (written in Java) How many words are there? Are there any lexical errors? Are there any syntactical errors?
2, no, yes
51
int Int = 0xFF-.7/7.; (written in Java) How many words are there? Are there any lexical errors? Are there any syntactical errors?
1, no, yes
52
What is a compiler?
53
What is an assembler?
54
What is a linker?
55
What is object code?
56
What is an interpreter?
57
What does portability mean?
58
What does it mean when a compiler + a virtual machine are used to process a program?
59
What does it mean when a compiler + compiler are used to process a program?
60
What is intermediate code?
61
What is the main advantage of using an interpreter over using a compiler?
62
What is the main advantage of using a compiler over an interpreter?
63
What are the primitive data types?
int, float, double, char, void
64
What types are not primitive?
array, structure, union, enum
65
How do objects, arrays, and primitive variables look in the memory?
66
Where are primitive global variables stored in the memory?
67
Where are primitive local variables stored in the memory?
68
Where are non-primitive global variables stored in the memory?
69
Where are non-primitive local variables stored in the memory?
70
What is a reference?
71
What is the heap?
72
What is the stack?
73
What is stack overflow?
74
What is the size of an int (in bytes)?
4
75
What is the size of a long (in bytes)?
8
76
What is the size of a float (in bytes)?
4
77
What is the size of a double (in bytes)?
8
78
What is a variable?
79
Why does a variable need a data type?
80
Is Java a weakly-typed or strongly-typed language?
strongly-typed
81
What is casting?
82
What is coercion?
83
What is structural equivalence?
84
What is name equivalence?
85
Does Java apply structural equivalence for non-primitive data?
86
Does Java apply name equivalence for non-primitive data?
87
Which language has strong-type checking? Java C C++
Java C++?
88
Which language has weak-type checking? Java C C++
C