CS 1300 EXAM #1 QUESTIONS WITH
COMPLETE SOLUTIONS
What is a program - ANSWER-A sequence of instructions that specifies how to perform
a computation on a computer
What does IDE mean - ANSWER-Integrated Development Environment
The rules that must be followed when writing are program are called - ANSWER-Syntax
Which of the following would be considered an algorithm? (Check all that apply.) -
ANSWER-Directions on how to change a tire
Which of the following is comment in Python - ANSWER-# This is a comment
Which of the following is a semantic error - ANSWER-Forgetting to divide by the
number of students when computing the class average
A name that refers to a value within your program is called a ___________ - ANSWER-
Variable
Comments tell the computer what you mean in your program - ANSWER-False
The print function would be considered to be - ANSWER-an output statement
An interpreter is a program that both translates and execute instructions in a high-level
language - ANSWER-True
What are programming errors called - ANSWER-Bugs
Which of the following is a syntax error - ANSWER-Forgetting a colon at the end of a
statement where one is required
Which of the following are valid variable names in Python - ANSWER-Sum
A(n) __________ is a set of instructions that a computer follows to perform a task -
ANSWER-Program
What is the data called that comes from the keyboard, file, or some device that is used
within your program - ANSWER-Input
What would be output by the following Python code?
print(type("42")) - ANSWER-<class 'str'>
, What is output by the following Python code?
print(16//3) - ANSWER-5
A good program development practice is to use iterative, incremental development -
ANSWER-True
What value is stored in the name_length variable after the following codes executes?
first_name = "Daffy"last_name = "Duck"name_length = len(first_name) + len(last_name
- ANSWER-9
After the following Python statements execute, what are the values of a and b?
a = 12b = aa = "Hi" - ANSWER-a is "Hi" and b is 12
What is printed when by the following Python code?
average = "Grade"average = 98.5print(average) - ANSWER-98.5
What is the value of the variable temperature after the following code executes?
temperature = 65rate = -5temperature = temperature + rate - ANSWER-60
What does the following Python code print?
print(int(-7.8)) - ANSWER--7
What is output by the following Python code - ANSWER-2.333333333
If a writing a program the best thing to do it to write the entire program at once and then
test it after the entire program is written - ANSWER-False
What does the following Python code print?
print(int(5.24)) - ANSWER-5
What is the value of result after the following code executes?
a = 5b = 3c = 8result = a * b + c - ANSWER-23
What is the value of result after the following code executes?
w = 2x = wy = x + 1result = w ** x ** y - ANSWER-256
What would be output by the following Python code?
print(type(3.14)) - ANSWER-<class 'float'>
What is the value of the variable score after the following code executes?
score = 26score = score/2 - ANSWER-13
Which of the following are valid Python strings? (Check all that apply.) -
ANSWER-"Hello"
What is output by the following Python code - ANSWER-1
COMPLETE SOLUTIONS
What is a program - ANSWER-A sequence of instructions that specifies how to perform
a computation on a computer
What does IDE mean - ANSWER-Integrated Development Environment
The rules that must be followed when writing are program are called - ANSWER-Syntax
Which of the following would be considered an algorithm? (Check all that apply.) -
ANSWER-Directions on how to change a tire
Which of the following is comment in Python - ANSWER-# This is a comment
Which of the following is a semantic error - ANSWER-Forgetting to divide by the
number of students when computing the class average
A name that refers to a value within your program is called a ___________ - ANSWER-
Variable
Comments tell the computer what you mean in your program - ANSWER-False
The print function would be considered to be - ANSWER-an output statement
An interpreter is a program that both translates and execute instructions in a high-level
language - ANSWER-True
What are programming errors called - ANSWER-Bugs
Which of the following is a syntax error - ANSWER-Forgetting a colon at the end of a
statement where one is required
Which of the following are valid variable names in Python - ANSWER-Sum
A(n) __________ is a set of instructions that a computer follows to perform a task -
ANSWER-Program
What is the data called that comes from the keyboard, file, or some device that is used
within your program - ANSWER-Input
What would be output by the following Python code?
print(type("42")) - ANSWER-<class 'str'>
, What is output by the following Python code?
print(16//3) - ANSWER-5
A good program development practice is to use iterative, incremental development -
ANSWER-True
What value is stored in the name_length variable after the following codes executes?
first_name = "Daffy"last_name = "Duck"name_length = len(first_name) + len(last_name
- ANSWER-9
After the following Python statements execute, what are the values of a and b?
a = 12b = aa = "Hi" - ANSWER-a is "Hi" and b is 12
What is printed when by the following Python code?
average = "Grade"average = 98.5print(average) - ANSWER-98.5
What is the value of the variable temperature after the following code executes?
temperature = 65rate = -5temperature = temperature + rate - ANSWER-60
What does the following Python code print?
print(int(-7.8)) - ANSWER--7
What is output by the following Python code - ANSWER-2.333333333
If a writing a program the best thing to do it to write the entire program at once and then
test it after the entire program is written - ANSWER-False
What does the following Python code print?
print(int(5.24)) - ANSWER-5
What is the value of result after the following code executes?
a = 5b = 3c = 8result = a * b + c - ANSWER-23
What is the value of result after the following code executes?
w = 2x = wy = x + 1result = w ** x ** y - ANSWER-256
What would be output by the following Python code?
print(type(3.14)) - ANSWER-<class 'float'>
What is the value of the variable score after the following code executes?
score = 26score = score/2 - ANSWER-13
Which of the following are valid Python strings? (Check all that apply.) -
ANSWER-"Hello"
What is output by the following Python code - ANSWER-1