PSU CMPSC 200 MIDTERM EXAM
QUESTIONS WITH CORRECT ANSWERS
MATLAB generally interprets computer code line by line from the top to the
| | | | | | | | | | | | |
bottom of a program. - CORRECT ANSWER✔✔-True
| | | | | |
Volatile Memory - CORRECT ANSWER✔✔-Temporary data storage
| | | | | |
Non-volatile Memory - CORRECT ANSWER✔✔-Permanant data storage
| | | | | |
Main Memory - CORRECT ANSWER✔✔-Stores programs and program data into
| | | | | | | | | |
random access memory | |
Arithmetic and Logic Unit (ALU) - CORRECT ANSWER✔✔-Performs mathematical
| | | | | | | | |
operations
Which of the following are characteristics of computers? - CORRECT ANSWER✔✔-
| | | | | | | | | |
1. Do not tire
| | |
2. Follow instructions precisely
| | |
3. Are reliable in most contexts
| | | | |
Which of the following are true about MATLAB variables? - CORRECT
| | | | | | | | | | |
ANSWER✔✔-1. May contain letters or numbers | | | | |
,2. Must begin with a letter
| | | | |
3. May end with a letter
| | | | |
The default angular unit in MATLAB is radians unless specified otherwise. -
| | | | | | | | | | | |
CORRECT ANSWER✔✔-True |
An array cannot contain multiple pieces of information. - CORRECT ANSWER✔✔-
| | | | | | | | | |
False
Which built-in command would you use if you wanted to generate uniformly
| | | | | | | | | | | |
distributed pseudorandom numbers? - CORRECT ANSWER✔✔-rand( )
| | | | | |
Which built-in command returns the largest number of elements in any
| | | | | | | | | | |
dimension of a variable? - CORRECT ANSWER✔✔-length( )
| | | | | | |
The semi-colon at the end of a line of code is generally an optional piece of
| | | | | | | | | | | | | | | |
syntax in the MATLAB programming language. - CORRECT ANSWER✔✔-True
| | | | | | | |
log(x) - CORRECT ANSWER✔✔-log base e of x
| | | | | | |
log10(x) - CORRECT ANSWER✔✔-log base 10 of x
| | | | | | |
ln(x) - CORRECT ANSWER✔✔-Not a valid MATLAB command
| | | | | | |
, 0 (zero) is the typical computer science representation for true, while 1 (one) is
| | | | | | | | | | | | | |
the typical computer science representation for false. - CORRECT ANSWER✔✔-
| | | | | | | | |
False
plot( ) - CORRECT ANSWER✔✔-Plots y-data points vs. x-data points
| | | | | | | | |
legend( ) - CORRECT ANSWER✔✔-Creates a legend for a plot
| | | | | | | | |
comet( ) - CORRECT ANSWER✔✔-Creates an animated plot
| | | | | | |
title( ) - CORRECT ANSWER✔✔-Adds a title to a plot
| | | | | | | | |
figure( ) - CORRECT ANSWER✔✔-Calls a figure, creating it if necessary
| | | | | | | | | |
clf - CORRECT ANSWER✔✔-Clears the contents of a figure, but does not delete
| | | | | | | | | | | | |
the figure window entirely
| | |
close - CORRECT ANSWER✔✔-Used to completely delete one or more figure
| | | | | | | | | | |
windows
axis( ) - CORRECT ANSWER✔✔-Used to control the axes of a plot
| | | | | | | | | | |
semilogx( ) - CORRECT ANSWER✔✔-Plots normal y vs. logarithm of x
| | | | | | | | | |
QUESTIONS WITH CORRECT ANSWERS
MATLAB generally interprets computer code line by line from the top to the
| | | | | | | | | | | | |
bottom of a program. - CORRECT ANSWER✔✔-True
| | | | | |
Volatile Memory - CORRECT ANSWER✔✔-Temporary data storage
| | | | | |
Non-volatile Memory - CORRECT ANSWER✔✔-Permanant data storage
| | | | | |
Main Memory - CORRECT ANSWER✔✔-Stores programs and program data into
| | | | | | | | | |
random access memory | |
Arithmetic and Logic Unit (ALU) - CORRECT ANSWER✔✔-Performs mathematical
| | | | | | | | |
operations
Which of the following are characteristics of computers? - CORRECT ANSWER✔✔-
| | | | | | | | | |
1. Do not tire
| | |
2. Follow instructions precisely
| | |
3. Are reliable in most contexts
| | | | |
Which of the following are true about MATLAB variables? - CORRECT
| | | | | | | | | | |
ANSWER✔✔-1. May contain letters or numbers | | | | |
,2. Must begin with a letter
| | | | |
3. May end with a letter
| | | | |
The default angular unit in MATLAB is radians unless specified otherwise. -
| | | | | | | | | | | |
CORRECT ANSWER✔✔-True |
An array cannot contain multiple pieces of information. - CORRECT ANSWER✔✔-
| | | | | | | | | |
False
Which built-in command would you use if you wanted to generate uniformly
| | | | | | | | | | | |
distributed pseudorandom numbers? - CORRECT ANSWER✔✔-rand( )
| | | | | |
Which built-in command returns the largest number of elements in any
| | | | | | | | | | |
dimension of a variable? - CORRECT ANSWER✔✔-length( )
| | | | | | |
The semi-colon at the end of a line of code is generally an optional piece of
| | | | | | | | | | | | | | | |
syntax in the MATLAB programming language. - CORRECT ANSWER✔✔-True
| | | | | | | |
log(x) - CORRECT ANSWER✔✔-log base e of x
| | | | | | |
log10(x) - CORRECT ANSWER✔✔-log base 10 of x
| | | | | | |
ln(x) - CORRECT ANSWER✔✔-Not a valid MATLAB command
| | | | | | |
, 0 (zero) is the typical computer science representation for true, while 1 (one) is
| | | | | | | | | | | | | |
the typical computer science representation for false. - CORRECT ANSWER✔✔-
| | | | | | | | |
False
plot( ) - CORRECT ANSWER✔✔-Plots y-data points vs. x-data points
| | | | | | | | |
legend( ) - CORRECT ANSWER✔✔-Creates a legend for a plot
| | | | | | | | |
comet( ) - CORRECT ANSWER✔✔-Creates an animated plot
| | | | | | |
title( ) - CORRECT ANSWER✔✔-Adds a title to a plot
| | | | | | | | |
figure( ) - CORRECT ANSWER✔✔-Calls a figure, creating it if necessary
| | | | | | | | | |
clf - CORRECT ANSWER✔✔-Clears the contents of a figure, but does not delete
| | | | | | | | | | | | |
the figure window entirely
| | |
close - CORRECT ANSWER✔✔-Used to completely delete one or more figure
| | | | | | | | | | |
windows
axis( ) - CORRECT ANSWER✔✔-Used to control the axes of a plot
| | | | | | | | | | |
semilogx( ) - CORRECT ANSWER✔✔-Plots normal y vs. logarithm of x
| | | | | | | | | |