Module 1 Quiz
最新提交作业的评分
100%
1.第 1 个问题
What does a compiler do?
Generates executable machine code from source code in a high-level language
Automatically formats source code in a readable way
Combines multiple files into a single program
Tests the basic functionality of the code
正确
That’s correct!
1/1 分
2.第 2 个问题
What is the scope of a variable?
The variable declaration
The instructions where the variable is assigned a value
Region of a program where the variable can be accessed
The set of values to which a variable can be assigned
正确
That’s correct! A variable’s scope defines the parts of a program that can “see” that variable.
1/1 分
3.第 3 个问题
What is Garbage Collection?
Reorganization of source code to reduce the number of function calls
Deallocation of objects which are no longer in use
Reorganization of source code to improve encapsulation and understandability
Deletion of unused segments of code
正确
That’s correct!
1/1 分
4.第 4 个问题
What does an interpreter do?
Converts instructions in a high-level language into machine code at runtime
Processes user inputs
Reads files in a given data format
Produces output data corresponding to each input region
正确
That’s correct!
1/1 分
5.第 5 个问题
True or False:
Concurrency always results in some performance improvement.
True
False
正确
That’s correct! Concurrency enables parallelism, but if parallel hardware is not present, speedup will not be achieved because multiple tasks cannot execute at the same time.
1/1 分
6.第 6 个问题
The type of a variable determines which of the following aspects of that variable? (Select ALL that are correct.)
Size in memory
正确
Correct! In declaring a variable’s type, the programmer specifies the amount of memory that needs to be allocated for that variable.
Operations that can be performed on the variable
正确
Correct! The variable’s type defines the nature of the variable along with the types of operations that can be performed on it.
The data that can be contained in the object
正确
Correct! The variable’s type specifies the nature of the data that can be contained (for example, integer vs. floating point number).
The number of characters in the variable’s name
1/1 分
7.第 7 个问题
What is the name of the package from which an executable program is generated?
fmt
os
init
main
正确
That’s correct!
1/1 分
8.第 8 个问题
Which of the following is an example of a short variable declaration?
x := 2.3
var x int =10
var x int
x=2.3
正确
That’s correct!