MODULE 1 PPL PRELIMS

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

1/171

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.

172 Terms

1
New cards

Who was Abu Ja’far Muhammad ibn Musa and what was his contribution to mathematics and computing?

Abu Ja’far Muhammad ibn Musa (780–850) lived in Baghdad and was the chief mathematician in Khalif Al Mamun’s “House of Wisdom.” He authored “A Compact Introduction To Calculation Using Rules Of Completion And Reduction” and introduced the concept of “al-gabr” (removing negative units from an equation by adding the same quantity to the other side).

2
New cards

Who was Gottfried Wilhelm Leibniz and what were his key contributions?

Gottfried Wilhelm Leibniz (1646–1716) invented calculus and the binary system

3
New cards

Who was Gottlöb Frege and what was his major contribution?

Gottlöb Frege (1848–1925) developed Predicate Logic

4
New cards

What were Alan Turing’s contributions to computing?

Alan Turing developed the concept of the Turing Machine

5
New cards

Who was Alonzo Church and what did he contribute to computing?

Alonzo Church (1903–1995) developed Lambda Calculus

6
New cards

What were Stephen Kleene’s contributions to computer science?

Stephen Kleene (1900–1994) worked on recursive functions and automata

7
New cards

What is the Church-Turing Thesis?

The Church-Turing Thesis states that recursion

8
New cards

Who was David Wheeler and what were his achievements?

David Wheeler (1927–2004) was the first computer science Ph.D. (1951)

9
New cards

Who was Dennis Ritchie and what was his main contribution?

Dennis Ritchie (1941–2011) designed the C programming language.

10
New cards

Who is Brian Kernighan and what is his role in C programming?

Brian Kernighan (1942– ) co-authored the first C programming language book and contributed to its development.

11
New cards

Who were the key figures in combinatorics related to computing?

Moses Schönfinkel (1889–1942) and Haskell Curry (1900–1982) were influential in combinatorics and combinatory logic.

12
New cards

Who contributed to Post-production systems in computing?

Emil Post (1897–1954) developed Post-production systems.

13
New cards

Who developed Markov algorithms?

Andrey Markov (1903–1979) developed Markov algorithms.

14
New cards

Who was Kristen Nygaard and what was his contribution?

Kristen Nygaard (1926–2002)

15
New cards

Portability

Ease of running programs on different platforms without modification.

16
New cards

Type Safety

Ability of the language to prevent type errors and enforce correct use of data types.

17
New cards

Performance

How efficiently programs execute in terms of speed and resource usage.

18
New cards

Ease in Debugging

Support for finding and fixing errors, including debugging tools and clear error messages.

19
New cards

System Resource Access

The extent to which the language allows direct interaction with hardware, memory, or low-level system functions.

20
New cards

Stability

How reliably programs run without crashes or unexpected behavior.

21
New cards

Learning Curve

How easy or difficult it is for a new programmer to learn and use the language effectively.

22
New cards

Size

The storage and memory footprint of programs written in the language (smaller is better).

23
New cards

Analysis

How well the language supports code analysis for optimization, verification, or understanding program behavior.

24
New cards

Availability in Several Facilities

The variety of built-in functions, libraries, and tools available for development.

25
New cards

NOTE

No single language can maximize all factors due to hardware limits. Trade-offs are necessary; there is no perfect programming language.

26
New cards
27
New cards

What is Machine Language?

The native language of the computer; the most basic type of computer language consisting of strings of numbers that the hardware can use. Different hardware types have different machine codes. Consists of two parts: OpCode (tells the computer what functions to perform) and Operand (tells where to find and store data).

28
New cards

What are the advantages of Machine Language?

Translation-free, high-speed.

29
New cards

What are the disadvantages of Machine Language?

Machine dependent, complex, error prone, tedious.

30
New cards

What is Assembly Language?

Invented in the 1950s, it is easier to work with than machine language. Uses mnemonics instead of binary opcodes, features macros and subroutines, and uses cryptic English-like phrases. Translated into object code by an assembler.

31
New cards

What is an Assembler?

A program that converts assembly code into binary code. Uses abbreviations for instructions, also consists of an opcode and an operand.

32
New cards

What are the advantages of Assembly Language?

Easier to understand and use, less error prone, efficient, more control on hardware.

33
New cards

What are the disadvantages of Assembly Language?

Machine dependent, harder to learn, slower development time, no standardization.

34
New cards

What are Higher-level Programming Languages?

More powerful than assembly languages, allowing programmers to work in a more English-like environment. Includes 3rd, 4th, and 5th generation languages.

35
New cards

What are Third-generation Languages (3G)?

The first to use true English-like phrasing, making them easier to use and portable across systems. Examples: Fortran, COBOL, C/C++, Java.

36
New cards

What are the advantages of 3G Languages?

Readability, machine independent, easier debugging, easier to maintain, easier documentation.

37
New cards

What are the disadvantages of 3G Languages?

Poor control on hardware, less efficient in translation.

38
New cards

What are Hybrid Languages?

Advanced 3G languages that combine 4G features. Often run without compilers and use interpreters. Usually do not assign types to variables. Examples: Python, Ruby, Perl.

39
New cards

What are Fourth-generation Languages (4G)?

Easier to use than 3G languages, may use text-based or visual environments with graphical tools. Often do not need a compiler. Examples: Visual Basic, SQL, Unix Shell, R, Matlab, LabVIEW.

40
New cards

What are Fifth-generation Languages (5G)?

A debated concept; uses artificial intelligence to create software and solve problems using constraints rather than algorithms. Example: Prolog.

41
New cards

Procedural Programming

Execution of code is based on each statement, called procedures. Originated from structural programming. Programs are written step-by-step as a list of instructions. Examples: COBOL, Algol.

42
New cards

Procedure

A mini-program or block of code that performs a specific task and can be called from anywhere in the main program.

43
New cards

Object-Oriented Programming (OOP)

Encapsulates data and behavior into objects that can interact with each other. Procedures are called methods. A class acts as the blueprint for objects. Examples: C++, Java, Swift.

44
New cards

Method

A function or procedure that belongs to a specific object or class in OOP.

45
New cards

Class

A blueprint that defines the attributes (data) and methods (behavior) of objects in OOP.

46
New cards

Functional Programming

Passes data from function to function to produce a result. Treats functions as data that can be passed, returned, and combined to form new functions. Avoids shared state and uses immutable data. Examples: Haskell, Lisp.

47
New cards

Immutable Data

Data that cannot be changed once created, common in functional programming.

48
New cards

Pure Function

A function that always returns the same result when given the same input, without side effects.

49
New cards

Logic Programming

Based on formal logic, using facts and rules to derive conclusions. Programs consist of logical statements, and computation is the process of proving queries. Examples: Prolog, Datalog.

50
New cards
51
New cards

Compilers

A program that translates a high-level language into machine language. During translation, the compiler reads the source program, checks for syntax errors, and will not create object code until all errors are resolved. After compiling, the resulting code is saved separately and can run independently anytime. If the source code is modified, it must be compiled again to apply changes.

52
New cards

Interpreters

A programming language translator similar to a compiler, but executes each translated line immediately before moving to the next. When an error is encountered, execution stops and an error is displayed.

53
New cards

Summary (Compiling in C)

The compiling process in C involves writing source code, compiling to check for errors, generating object code when error-free, and linking to create an executable program.

54
New cards

Compiler vs Interpreter - Object Code

Compiler: Provides separate object program

55
New cards

Compiler vs Interpreter - Translation Process

Compiler: Converts program into entire machine code

56
New cards

Compiler vs Interpreter - Debugging

Compiler: Slower removal of errors (due to compile time and runtime errors)

57
New cards

Compiler vs Interpreter - Implementation

Compiler: Complex because they require hardcore coding and more memory to execute a program

58
New cards

Compiler vs Interpreter - Execution Time

Compiler: Faster because each statement is translated only once and saved in an object file, which can be executed anytime without translating again

59
New cards

C Program Development Environment - Edit

Program is created in the editor and stored on disk.

60
New cards

C Program Development Environment - Preprocess

Preprocessor processes the code (e.g., handling #include, #define).

61
New cards

C Program Development Environment - Compile

Compiler converts the preprocessed code into object code and stores it on disk.

62
New cards

C Program Development Environment - Link

Linker links the object code with required libraries to produce an executable.

63
New cards

C Program Development Environment - Load

Loader loads the executable into primary memory.

64
New cards

C Program Development Environment - Execute

CPU executes the instructions, possibly storing new data values as the program runs.

65
New cards

Components - Editor

For writing code.

66
New cards

Components - Preprocessor

Handles directives.

67
New cards

Components - Compiler

Generates object code.

68
New cards

Components - Linker

Combines object code and libraries.

69
New cards

Components - Loader

Loads program into memory.

70
New cards

Components - CPU

Executes instructions.

71
New cards

Components - Disk

Stores source and object code.

72
New cards

Components - Primary Memory

Holds the program during execution.

73
New cards

What are the three main definitions of a program?

A set of structured activities; a tool for instructing machines; a notation for algorithms.

74
New cards

What is programming?

The process of creating programs; the software that controls a machine; the logic expressed in such software; operating instructions.

75
New cards

What is a programming language?

A formal notation for specifying instructions, with syntax defined by context-free grammar, semantics for each syntactic construct, and a practical implementation on a real or virtual machine.

76
New cards

What are the three main ways to execute a programming language?

Translation, compilation, interpretation.

77
New cards

What is the trade-off between efficiency and portability?

Efficiency means faster execution optimized for specific hardware, while portability means the ability to run on multiple platforms without modification; optimizing for one can reduce the other.

78
New cards

Why do we design new programming languages?

Because of diverse applications, diverse programmers, changing problems, complexity classes like P vs NP vs NP-complete, changing computers, Moore’s Law-like hardware growth, and progress in language design and implementation.

79
New cards

What are the five elements in a variable’s 5-tuple?

Name, Type, Scope, Location value, Real value.

80
New cards

What does the "Name" in a variable’s 5-tuple represent?

The name of the variable.

81
New cards

What does the "Type" in a variable’s 5-tuple represent?

The data type of the variable.

82
New cards

What does the "Scope" in a variable’s 5-tuple represent?

The visibility of the variable (global or local).

83
New cards

What does the "Location value" in a variable’s 5-tuple represent?

The memory address where the variable is stored.

84
New cards

What does the "Real value" in a variable’s 5-tuple represent?

The actual value that the variable holds.

85
New cards

What must happen before creating a variable?

It must be declared.

86
New cards

How are variables declared in most languages?

By stating the type followed by the variable name.

87
New cards

Does variable declaration apply in functional languages?

No (more on that later).

88
New cards

Where is all program data stored?

In memory.

89
New cards

What is an address in programming?

A specific location in memory where data is stored.

90
New cards

Example of variable assignment in C: int i = 0; — what does this mean?

i is an integer variable with a value of 0.

91
New cards

Why does int = 0; cause an error?

Because there is no variable name (no location value).

92
New cards

What does int i; do in C?

Declares i as an int with a random value.

93
New cards

Why is int c = ; not allowed in C?

Because there is no value on the right side of the assignment.

94
New cards

What are basic arithmetic operators in C?

=, +, -, *, /, %.

95
New cards

What does ++ do in C?

Increments the value by 1.

96
New cards

What does -- do in C?

Decrements the value by 1.

97
New cards

What are compound operators in C?

+=, -=, *=, /=, %=.

98
New cards

What does 5 / 2 yield in C?

2 (integer division).

99
New cards

What does 5.0 / 2 yield in C?

2.5 (double division).

100
New cards

What does 5 % 2 yield in C?

1 (remainder).