COMPLETE SOLUTIONS VERIFIED
M1Q1: Features of the imperative or procedural paradigm includes
- manipulation of named data (variables)
- conditional statements
M1Q1: Logic programming languages divide the program into reasonable sized
pieces named functions or procedures or modules or subroutines.
False
M1Q1: The compiler executes the program
True
M1Q1: Features of the functional paradigm includes
- simpler semantics
- expresses computations in terms of mathematical functions
M1Q1: Is the following statement true or false?
Prolog is a functional programming language
False
M1Q1: Assembly language translates instructions written in a high-level
programing language to binary code
False
M1Q1: Features of the logic paradigm includes
,- define relationships between components
- a program is a set of facts
M1Q1: Features of the object-oriented paradigm includes
- inheritance
- classes and objects
M1Q1: All high-level programming languages should have a way to define
variables which should always have defined data type.
False
M1Q1: All high-level languages should have control structures such as
conditions and loops
False
M1Q2: If you like to see accurate debugging information, which of the following
program processing would you recommend?
Interpretation because it offers better debugging info
M1Q2: What is the main reason of applying two-step translation of high level
programming language?
One compiler for all machines
M1Q2: Macros-Processing in C takes place during which phase?
Pre-processing, macro is processed in compiler before the actual translation from high
level program to execute
M1Q2: Assume a function requires 20 lines of machine code and will be called 10
times in the main program. You can choose to implement it using a function
, definition or a macro definition. Compared with the function definition, macro
definition will lead the compiler to generate, for the entire program, ______
a longer machine code but with shorter execution time
M1Q2: A final method in Java defines
a constant
M1Q2: Explicit type conversion is commonly refer to as __________ .
casting
M1Q2: Implicit type conversion is commonly refer to as __________ .
coercion
M1Q2: Which of the following statements are correct if a language is strongly
typed. Select all that apply.
- type errors are always reported
- each name in a program has a single type associated with it
M1Q2: Which of the following orthogonality describe this example:
If a block allows one statement, it should allow zero or more statements within
that same block.
Number Orthogonality
M2Q1: Why do we need to flush the input buffer?
An unformatted input can read the newline character left from the previous input
operation.
M2Q1: In the C-Style input function scanf("%d", &i), what does the character "&"
mean?
that the parameter is the address of the variable where the value should be stored.