CPSC 120A Exam 1 Review Solved 100%
Bisection debugging involves adding the cout statement inside the suspicious area.
Where should you place the cout statement? - ANSWER-in the middle of the suspicious
area
Complete the sentence: A forward declaration is necessary when... - ANSWER-a
function is called before it is defined.
Consider the following question that is asked verbally in class:
"This is stupid and I'm over it."
Does this question meet the six criteria for being a productive question? - ANSWER-no,
the question reflects poor etiquette
Consider the following question, that is asked verbally in class:
"I'm working on debugging a compile error in today's lab. Help"
Does this question meet the six criteria for being a productive question? - ANSWER-no,
the asker needs to say how the problem arises, but did not
Consider the following question, that is verbally asked in class:
"Im working on testing part 3 of today's lab. I'm getting a logic error. The 700 test case
should output 0 but instead it outputs -1."
Does this question meet the six criteria for being a productive question? - ANSWER-yes
Fill in the blank: VS code is a... - ANSWER-text editor
In addition to a computer, which device do you need to install Linux - ANSWER-a USB
drive
Suppose that a program defines a function. How many times can main call the function?
- ANSWER-any number of times
Suppose you have a file named tictactoe.cc which is a C++ source file. It implements a
Tic Tac Toe game. What choice below is the best command to compile the source file to
a program? - ANSWER-clang++ tictactoe.cc
The command:
~/cpp-hello-world$ a.out
Bisection debugging involves adding the cout statement inside the suspicious area.
Where should you place the cout statement? - ANSWER-in the middle of the suspicious
area
Complete the sentence: A forward declaration is necessary when... - ANSWER-a
function is called before it is defined.
Consider the following question that is asked verbally in class:
"This is stupid and I'm over it."
Does this question meet the six criteria for being a productive question? - ANSWER-no,
the question reflects poor etiquette
Consider the following question, that is asked verbally in class:
"I'm working on debugging a compile error in today's lab. Help"
Does this question meet the six criteria for being a productive question? - ANSWER-no,
the asker needs to say how the problem arises, but did not
Consider the following question, that is verbally asked in class:
"Im working on testing part 3 of today's lab. I'm getting a logic error. The 700 test case
should output 0 but instead it outputs -1."
Does this question meet the six criteria for being a productive question? - ANSWER-yes
Fill in the blank: VS code is a... - ANSWER-text editor
In addition to a computer, which device do you need to install Linux - ANSWER-a USB
drive
Suppose that a program defines a function. How many times can main call the function?
- ANSWER-any number of times
Suppose you have a file named tictactoe.cc which is a C++ source file. It implements a
Tic Tac Toe game. What choice below is the best command to compile the source file to
a program? - ANSWER-clang++ tictactoe.cc
The command:
~/cpp-hello-world$ a.out