
W07: CP04 Quiz (CSCC0823)
Quiz by Bryan N. Manalaotao
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
15 questions
Show answers
- Q1What is the primary characteristic of an array data type?It can store elements of different typesIt does not support systematic sequencing through the structureIt allows for variable-length storage allocationIts elements are identified by their position relative to the first element20s
- Q2Which programming languages typically include sets as a data type?Pascal and Modula-2C and C++JavaScript and RubyPython and Java20s
- Q3What is the primary purpose of variant records?To have multiple variations of record structuresTo store variables of the same data type togetherTo facilitate pattern matching operationsTo allow for dynamic storage allocation20s
- Q4In which programming language is the syntax "p^" address used to reference a field in a record using a pointer?PascalC++ADAC20s
- Q5What is a dangling pointer?A pointer that points to the first element of an arrayA pointer that contains the address of a dynamic variableA pointer that contains an invalid memory addressA pointer that points to a variable outside its scope20s
- Q6What is the purpose of garbage collection in programming languages?To manage pointers effectivelyTo optimize memory usage for arraysTo allocate memory dynamically during runtimeTo automatically reclaim memory allocated to variables20s
- Q7Which phase of garbage collection involves marking reachable cells as not being garbage?Phase 4Phase 1Phase 3Phase 220s
- Q8How are sets typically stored in memory?As bit stringsAs hash tablesAs linked listsAs arrays of elements20s
- Q9What is the primary difference between arrays and records?Arrays can have varying lengths, while records have fixed lengthsArrays are stored in contiguous memory, while records are notArrays support dynamic storage allocation, while records do notArray elements must be of the same type, while record fields can be of different types20s
- Q10Which programming language uses discriminated unions?PythonJavaScriptAlgol 68C20s
- Q11What is the purpose of pointer operations?To deallocate memory from a pointer variableTo create a dangling pointerTo sets a pointer variable to the address of some objectTo assign a memory address to a pointer variable20s
- Q12How are multi-dimensional arrays typically implemented?Using dynamic allocation for each dimensionUsing row-major orderUsing column-major orderUsing both row-major and column-major orders20s
- Q13Which type of array binding allows for maximal flexibility, allowing arrays to grow and shrink during runtime?Dynamic arraySemi-dynamic bindingSemi-static bindingStatic array20s
- Q14What is the purpose of a constrained variant variable in ADA?To provide flexibility in defining record structuresTo restrict the range of possible values for a recordTo simplify type checking during compilationTo restrict access to certain fields within a record20s
- Q15How are pointers implemented in microcomputers based on Intel microprocessors?As arrays of memory addressesAs pairs of 16-bit wordsAs hash tablesAs single values stored in two or four-byte memory cells20s