1/300
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
A data type can be defined as a collection of values from a _ _.
A. syntax
B. token
C. structure
D. domain
DOMAIN
The structural approach defines a type based on the _ _ of data.
A. syntax
B. value
C. internal structure
D. execution
INTERNAL STRUCTURE
The implementer's approach groups types into _ _ classes.
A. equivalence
B. execution
C. syntax
D. logical
EQUIVALENCE
The abstraction approach defines a type as a set of _ _.
A. operations
B. syntax rules
C. tokens
D. variables
OPERATIONS
Computers are naturally _ _.
A. logical
B. typed
C. structured
D. untyped
UNTYPED
Type checking ensures that _ _ operations do not occur.
A. syntax
B. valid
C. meaningful
D. meaningless
MEANINGLESS
Strong typing prevents _ _ operations on incompatible data)
A. valid
B. inappropriate
C. syntax
D. correct
INAPPROPRIATE
Static typing performs checks at _ _ time.
A. load
B. runtime
C. execution
D. compile
COMPILE
A violation of type rules is called a type _ _.
A. error
B. token
C. clash
D. syntax
CLASH
Coercion is the conversion of a value into another _ _.
A. variable
B. operator
C. syntax
D. data type
DATA TYPE
A data type provides meaning by defining:
A. tokens
B. operations on data
C. syntax
D. memory
OPERATIONS ON DATA
Denotational approach focuses on:
A. structure
B. values and domains
C. execution
D. syntax
VALUES AND DOMAINS
Structural approach emphasizes:
A. execution
B. values
C. internal organization
D. syntax
INTERNAL ORGANIZATION
Type checking is used to:
A. speed execution
B. reduce memory
C. prevent invalid operations
D. parse tokens
PREVENT INVALID OPERATIONS
Strong typing ensures:
A. faster execution
B. type safety
C. tokenization
D. syntax correctness
TYPE SAFETY
Static typing differs from dynamic typing because:
A. it uses syntax
B. it checks at runtime
C. it ignores types
D. it checks at compile time
IT CHECKS AT COMPILE TIME
Python is considered:
A. weak typed
B. untyped
C. static typed
D. strong dynamic typed
STRONG DYNAMIC TYPED
Java uses:
A. dynamic only
B. weak typing
C. no typing
D. mixed typing (static + dynamic)
MIXED TYPING (STATIC + DYNAMIC)
Expressions have:
A. tokens
B. values
C. syntax only
D. no value
VALUES
Objects are:
A. tokens
B. entities with names
C. syntax
D. operators
ENTITIES WITH NAMES
3 * 5 produces a _ _ in denotational semantics.
A. token
B. structure
C. syntax
D. domain value
DOMAIN VALUE
int x = 10, float y = x demonstrates:
A. coercion
B. syntax
C. iteration
D. recursion
COERCION
a + b where a is int and b is string causes:
A. syntax error
B. token error
C. valid operation
D. type error
TYPE ERROR
Boolean is classified as:
A. reference type
B. dynamic type
C. composite type
D. discrete type
DISCRETE TYPE
Arrays are:
A. tokens
B. scalar types
C. composite types
D. syntax
COMPOSITE TYPES
Records consist of:
A. operators
B. fields
C. tokens
D. loops
FIELDS
Union allows:
A. no values
B. multiple values simultaneously
C. syntax only
D. one value at a time
ONE VALUE AT A TIME
Enumeration type represents:
A. numeric values
B. strings
C. predefined constants
D. syntax
PREDEFINED CONSTANTS
Type inference determines:
A. tokens
B. memory
C. syntax
D. type of expressions
TYPE OF EXPRESSIONS
Type compatibility checks:
A. syntax
B. parsing
C. valid usage
D. tokens
VALID USAGE
Structural equivalence compares:
A. names
B. structure
C. tokens
D. syntax
STRUCTURE
Name equivalence compares:
A. declarations
B. syntax
C. structure
D. execution
DECLARATIONS
Type inference depends on:
A. tokens
B. syntax
C. operand types
D. memory
OPERAND TYPES
Coercion relaxes:
A. type checking
B. execution
C. parsing
D. syntax
TYPE CHECKING
Composite types differ from scalar types because:
A. single value
B. multi-valued
C. syntax
D. tokens
MULTI-VALUED
Discrete types are:
A. dynamic
B. countable
C. syntax
D. continuous
COUNTABLE
Floating-point types represent:
A. syntax
B. tokens
C. integers
D. real numbers
REAL NUMBERS
Type systems enforce:
A. tokens
B. rules for types
C. execution
D. syntax
RULES FOR TYPES
Type clash occurs when:
A. execution stops
B. syntax fails
C. tokens fail
D. types mismatch
TYPES MISMATCH
Strong typing reduces:
A. flexibility
B. tokens
C. syntax
D. runtime errors
RUNTIME ERRORS
Strong typing is preferred because it:
A. slows execution
B. increases safety
C. reduces syntax
D. ignores errors
INCREASES SAFETY
Static typing improves:
A. syntax
B. runtime flexibility
C. compile-time error detection
D. tokens
COMPILE-TIME ERROR DETECTION
Dynamic typing is useful because:
A. tokens
B. syntax
C. faster compile
D. flexible runtime
FLEXIBLE RUNTIME
Coercion can be risky because it:
A. hides errors
B. improves syntax
C. reduces memory
D. speeds execution
HIDES ERRORS
Composite types improve:
A. parsing
B. syntax
C. tokens
D. data organization
DATA ORGANIZATION
Designing a type system requires:
A. rules and operations
B. syntax only
C. tokens only
D. memory
RULES AND OPERATIONS
Creating new data types involves:
A. abstraction
B. tokens
C. syntax only
D. execution
ABSTRACTION
Efficient type design ensures:
A. correctness and safety
B. parsing
C. syntax
D. tokens
CORRECTNESS AND SAFETY
Advanced languages integrate:
A. static and dynamic typing
B. syntax only
C. parsing
D. tokens only
STATIC AND DYNAMIC TYPING
A complete type system includes:
A. syntax only
B. tokens only
C. execution
D. equivalence, compatibility, inference ,
EQUIVALENCE, COMPATIBILITY, INFERENCE
Control flow refers to the _ _ of execution in a program.
A. Structure
B. Syntax
C. Memory
D. Order
ORDER
Sequencing means:
A. Recursion
B. Looping
C. Order of execution
D. Conditional execution
ORDER OF EXECUTION
Selection is also known as:
A. Alternation
B. Recursion
C. Iteration
D. Execution
ALTERNATION
Iteration refers to:
A. Loops
B. Branching
C. Memory
D. Functions
LOOPS
Recursion is defined as:
A. Assignment
B. Selection
C. Function calling itself
D. Looping
FUNCTION CALLING ITSELF
Procedural abstraction involves:
A. Functions
B. Tokens
C. Memory
D. Syntax
FUNCTIONS
Exception handling deals with:
A. Runtime anomalies
B. Tokens
C. Syntax errors
D. Parsing
RUNTIME ANOMALIES
Operator precedence determines:
A. Order of evaluation
B. Memory usage
C. Syntax
D. Execution time
ORDER OF EVALUATION
Associativity determines the following:
A. Execution
B. Tokens
C. Memory
D. Operator grouping
OPERATOR GROUPING
Infix notation places operators:
A. Between operands
B. Before operands
C. After operands
D. Outside operands
BETWEEN OPERANDS
Control flow structures guide:
A. Tokens
B. Execution path
C. Syntax
D. Memory
EXECUTION PATH
Selection statements include:
A. recursion
B. if, case
C. for, while
D. assignment ,
IF, CASE
Iteration structures include:
A. loops
B. syntax
C. if
D. recursion
LOOPS
Recursion differs from iteration because it:
A. Uses loops
B. Calls itself
C. Uses syntax
D. Uses memory
CALLS ITSELF
Operator precedence resolves:
A. Evaluation ambiguity
B. Syntax errors
C. Compilation
D. Runtime errors
EVALUATION AMBIGUITY
Parentheses are used to:
A. Execute faster
B. Avoid syntax
C. Override precedence
D. Reduce memory
OVERRIDE PRECEDENCE
Prefix notation places operators:
A. After operands
B. Inside operands
C. Before operands
D. Between operands
BEFORE OPERANDS
Postfix notation places operators:
A. Between operands
B. After operands
C. Around operands
D. Before operands
AFTER OPERANDS
Expressions produce:
A. Values
B. Syntax
C. No output
D. Side effects only
VALUES
Statements are executed for:
A. Tokens
B. Value
C. Side effects
D. Syntax
SIDE EFFECTS
(a + b) * c uses parentheses to:
A. Change precedence
B. Increase speed
C. Avoid syntax
D. Reduce memory
CHANGE PRECEDENCE
In a + b * c
multiplication occurs:
A. Simultaneously
B. Randomly
C. Last
D. First
FIRST
Postfix of A + B is:
A. A+B
B. BA+
C. AB+
D. +AB
AB+
Prefix of A * B is:
A. AB
B. BA*
C. A*B
D. AB*
AB
Short-circuit evaluation occurs in:
A. Arithmetic
B. Assignment
C. Syntax
D. Logical operators
LOGICAL OPERATORS
In AND operation if first is false:
A. Continue
B. Stop evaluation
C. Error
D. Restart
STOP EVALUATION
Assignment x += 5 is equivalent to:
A. x = 5
B. x = x - 5
C. x = 5 + x
D. x = x + 5
X = X + 5
Multiple assignment a = b = 0 means:
A. Only b zero
B. Only a zero
C. Both zero
D. Error
BOTH ZERO
Expression b + c produces:
A. Syntax
B. Value
C. Side effect
D. Error
VALUE
Statement list.sort() produces:
A. Side effect
B. Value
C. Token
D. Syntax
SIDE EFFECT
Precedence ensures:
A. Correct evaluation order
B. Execution
C. Memory allocation
D. Syntax correctness
CORRECT EVALUATION ORDER
Associativity determines:
A. Memory
B. Order of same precedence operators
C. Syntax
D. Order of different operators
ORDER OF SAME PRECEDENCE OPERATORS
Infix is most common because:
A. Binary
B. Human-readable
C. Machine-friendly
D. Faster
HUMAN-READABLE
Prefix avoids:
A. Execution
B. Ambiguity
C. Memory
D. Syntax
AMBIGUITY
Postfix is used in:
A. Compilers/intermediate code
B. High-level languages
C. Syntax only
D. Hardware
COMPILERS/INTERMEDIATE CODE
Short-circuit improves:
A. Syntax
B. Memory
C. Compilation
D. Efficiency
EFFICIENCY
Value-oriented languages treat variables as:
A. References
B. Values
C. Tokens
D. Objects
VALUES
Reference-oriented languages treat variables as:
A. Syntax
B. Values
C. Tokens
D. References
REFERENCES
Expressions differ from statements because:
A. Produce tokens
B. Produce syntax
C. Produce memory
D. Produce values
PRODUCE VALUES
Statement-oriented languages focus on:
A. Tokens
B. Expressions
C. Execution steps
D. Values
EXECUTION STEPS
Which is clearer for humans?
A. Binary
B. Infix
C. Prefix
D. Postfix
INFIX
Parentheses improve:
A. Syntax
B. Memory
C. Clarity
D. Speed
CLARITY
Short-circuiting is beneficial because:
A. Increases memory
B. Saves computation
C. Complicates syntax
D. Slows execution
SAVES COMPUTATION
Assignment is critical because it:
A. Reduces memory
B. Changes program state
C. Avoids execution
D. Defines syntax
CHANGES PROGRAM STATE
Recursion is powerful because it:
A. Eliminates loops
B. Reduces syntax
C. Avoids memory
D. Simplifies problems
SIMPLIFIES PROBLEMS
Designing control flow requires:
A. Memory
B. Execution structure
C. Syntax only
D. Tokens
EXECUTION STRUCTURE
Combining iteration and recursion improves:
A. Syntax
B. Tokens
C. Problem solving
D. Memory
PROBLEM SOLVING
Efficient control flow design focuses on:
A. Syntax
B. Tokens
C. Execution clarity
D. Parsing
EXECUTION CLARITY
A new evaluation model must define:
A. Memory
B. Precedence and associativity
C. Tokens
D. Syntax only
PRECEDENCE AND ASSOCIATIVITY
Advanced control flow integrates:
A. Syntax only
B. Selection, iteration, recursion
C. Memory only
D. Tokens only ,
SELECTION, ITERATION, RECURSION