CSE 101 EXAM 1 QUESTIONS AND VERIFIED
ANSWERS
Given a valid algorithm for a task, which of the following is TRUE?
- It might take eternity to finish.
- It must be executed on a computer.
- It might be completed either by manual or automatic labor.
- It might take infinite resources.
- Only a few programming languages could be used to run it on a computer. - Answers -
It might be completed either by manual or automatic labor.
The data stored in main memory vanishes after the computer is turned off. - Answers -
False
Which one of the following belongs to the "Big Ideas" related to Computer Science
(CS)?
- GPS
- The Internet
- WiFi
- Silicon chips
- Cryptography - Answers - The Internet
Which statement below is FALSE for an algorithm?
- It is a sequence of instructions.
- It takes finite resources.
- It takes finite time.
- It is unambiguous in nature.
- It is dependent on a programming language of choice. - Answers - It is dependent on a
programming language of choice.
Best summarizes the discipline of computer science? - Answers - the study of problem
solving with the help of computers
Which of the following hardware devices can be used for permanently storing a
program's data while the computer is turned off?
- motherboard
- central processing unit
- solid state disk
,- main memory - Answers - solid state disk
The data stored in a solid state drive vanishes after the computer is turned off. -
Answers - False
What is the primary purpose of a computer's motherboard? - Answers - to connect the
computer's various components together
Detecting logical errors in code is the responsibility of _________. - Answers - the
programmer
Detecting syntax errors in code is the responsibility of _________. - Answers - the
interpreter
Suppose we included the code math.sqrt(5) in a code cell in Colab, but forgot to import
the math module first. What will happen when we run the code cell? - Answers - The
code will crash.
Which of the following would be considered expressions in Python?
I. 5
II. 5+2
III. def
IV. "Hello"
V. if - Answers - I, II and IV only
Which one of the following refers to the rules of a programming language that a
programmer must follow when developing software in that language? - Answers -
syntax
Python is a high-level language. - Answers - True
Which of the following is one of the reasons that Python is a popular language with
novice programmers? - Answers - Python's rules are simpler than the rules of many
other languages.
A fictional country has 3 denominations of money: gold, silver and copper coins.
1 gold coin = 20 silver coins
1 silver coin = 4 copper coins
Given a total number of copper coins (given in the variable copper), we want the
computer to tell us how many gold coins (gold), silver coins (silver) and copper coins
(copper) are needed to make change while minimizing the number of coins.
Incomplete code is given below. Choose the option below that correctly completes the
code segments marked A and B.
, copper = 1000 # or any other positive integer
gold = copper // A
copper = copper % A
silver = copper // B
copper = copper % B - Answers - Replace A with 80, replace B with 4
What is the value of the following Python expression?
2 == 9
- 0.2222...
- This is an error
-2
- True
- None of these - Answers - None of these
Which of the following is the operator we use in Python to compute a total
incrementally? - Answers - +=
Which of the following would compute 5% of x and store that value in the variable y?
- y = 5% x
- y = x.5%
- y = 5% of x
- y = 5% * x
- None of these is correct - Answers - None of these is correct
Which of the following, if any, is NOT a valid Python variable name?
- HACKERS
- g33333
- if
- underscores____
- All of these are valid variable names - Answers - if
Select ALL of the expressions below that evaluate to the integer 1.
-5%3
-3%5
- 5 // 3
-3/5
- - Answers - 5 // 3
Select ALL of the values for x so that 5 - x equals x % 5.
-0
-5
ANSWERS
Given a valid algorithm for a task, which of the following is TRUE?
- It might take eternity to finish.
- It must be executed on a computer.
- It might be completed either by manual or automatic labor.
- It might take infinite resources.
- Only a few programming languages could be used to run it on a computer. - Answers -
It might be completed either by manual or automatic labor.
The data stored in main memory vanishes after the computer is turned off. - Answers -
False
Which one of the following belongs to the "Big Ideas" related to Computer Science
(CS)?
- GPS
- The Internet
- WiFi
- Silicon chips
- Cryptography - Answers - The Internet
Which statement below is FALSE for an algorithm?
- It is a sequence of instructions.
- It takes finite resources.
- It takes finite time.
- It is unambiguous in nature.
- It is dependent on a programming language of choice. - Answers - It is dependent on a
programming language of choice.
Best summarizes the discipline of computer science? - Answers - the study of problem
solving with the help of computers
Which of the following hardware devices can be used for permanently storing a
program's data while the computer is turned off?
- motherboard
- central processing unit
- solid state disk
,- main memory - Answers - solid state disk
The data stored in a solid state drive vanishes after the computer is turned off. -
Answers - False
What is the primary purpose of a computer's motherboard? - Answers - to connect the
computer's various components together
Detecting logical errors in code is the responsibility of _________. - Answers - the
programmer
Detecting syntax errors in code is the responsibility of _________. - Answers - the
interpreter
Suppose we included the code math.sqrt(5) in a code cell in Colab, but forgot to import
the math module first. What will happen when we run the code cell? - Answers - The
code will crash.
Which of the following would be considered expressions in Python?
I. 5
II. 5+2
III. def
IV. "Hello"
V. if - Answers - I, II and IV only
Which one of the following refers to the rules of a programming language that a
programmer must follow when developing software in that language? - Answers -
syntax
Python is a high-level language. - Answers - True
Which of the following is one of the reasons that Python is a popular language with
novice programmers? - Answers - Python's rules are simpler than the rules of many
other languages.
A fictional country has 3 denominations of money: gold, silver and copper coins.
1 gold coin = 20 silver coins
1 silver coin = 4 copper coins
Given a total number of copper coins (given in the variable copper), we want the
computer to tell us how many gold coins (gold), silver coins (silver) and copper coins
(copper) are needed to make change while minimizing the number of coins.
Incomplete code is given below. Choose the option below that correctly completes the
code segments marked A and B.
, copper = 1000 # or any other positive integer
gold = copper // A
copper = copper % A
silver = copper // B
copper = copper % B - Answers - Replace A with 80, replace B with 4
What is the value of the following Python expression?
2 == 9
- 0.2222...
- This is an error
-2
- True
- None of these - Answers - None of these
Which of the following is the operator we use in Python to compute a total
incrementally? - Answers - +=
Which of the following would compute 5% of x and store that value in the variable y?
- y = 5% x
- y = x.5%
- y = 5% of x
- y = 5% * x
- None of these is correct - Answers - None of these is correct
Which of the following, if any, is NOT a valid Python variable name?
- HACKERS
- g33333
- if
- underscores____
- All of these are valid variable names - Answers - if
Select ALL of the expressions below that evaluate to the integer 1.
-5%3
-3%5
- 5 // 3
-3/5
- - Answers - 5 // 3
Select ALL of the values for x so that 5 - x equals x % 5.
-0
-5