Problem Solving with Computers Pre-Test Questions - 533 Verified Questions

Page 1


Problem Solving with Computers Pre-Test Questions

Course Introduction

This course introduces students to systematic approaches for analyzing and solving problems using computers. Emphasizing computational thinking, algorithm development, and basic programming concepts, students will learn how to break down complex problems into manageable components, design logical solutions, and implement these solutions through coding in a high-level programming language. Topics include data representation, decision structures, iteration, and introductory debugging techniques. The course provides foundational skills in using computers as tools for problem solving, preparing students for more advanced courses in computer science and related fields.

Recommended Textbook

Starting Out with Python 4th Edition by Tony Gaddis

Available Study Resources on Quizplus

13 Chapters

533 Verified Questions

533 Flashcards

Source URL: https://quizplus.com/study-set/2419 Page 2

Chapter 1: Introduction to Computers and Programming

Available Study Resources on Quizplus for this Chatper

39 Verified Questions

39 Flashcards

Source URL: https://quizplus.com/quiz/48072

Sample Questions

Q1) The term ___________ refers to all the physical devices that make up a computer.

Answer: hardware

Q2) What is the largest value that can be stored in one byte?

A) 255

B) 128

C) 8

D) 65535

Answer: A

Q3) Which type of error prevents the program from running?

A) syntax

B) human

C) grammatical

D) logical

Answer: A

Q4) Programs are commonly referred to as

A) system software

B) software

C) application software

D) utility programs

Answer: B

To view all questions and flashcards with answers, click on the resource link above. Page 3

Chapter 2: Input, Processing, and Output

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/48073

Sample Questions

Q1) The line continuation character is a A) #

B) % C) &

D) \

Answer: D

Q2) A(n)__________ is a name that represents a value stored in the computer's memory.

Answer: variable

Q3) A(n)__________ character is a special character that is preceded with a backslash (\),appearing inside a string literal.

Answer: escape

Q4) Since a named constant is just a variable,it can change any time during a program's execution.

A)True

B)False

Answer: False

Q5) A(n)__________ is a single task that the program must perform in order to satisfy the customer.

Answer: software requirement

4

To view all questions and flashcards with answers, click on the resource link above.

Chapter 3: Decision Structures and Boolean Logic

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/48074

Sample Questions

Q1) Nested decision statements are one way to test more than one condition.

A)True

B)False

Answer: True

Q2) In a decision structure,the action is ___________ executed because it is performed only when a specific condition is true.

Answer: conditionally

Q3) What is the result of the following Boolean expression,given that x = 5,y = 3,and z= 8?

Not (x < y or z > x)and y < z

A) True

B) False

C) 8

D) 5

Answer: B

Q4) Short -circuit evaluation is only performed with the not operator.

A)True

B)False

Answer: False

To view all questions and flashcards with answers, click on the resource link above. Page 5

Chapter 4: Repetition Structures

Available Study Resources on Quizplus for this Chatper

41 Verified Questions

41 Flashcards

Source URL: https://quizplus.com/quiz/48075

Sample Questions

Q1) What will be displayed after the following code is executed? total \( =0 \) for count in range \( (4,6): \)

\(\quad\)total \( += \) count

\(\quad\)print (total)

Q2) In Python,you would use the __________ statement to write a count-controlled loop.

Q3) A(n)__________ validation loop is sometimes called an error trap or an error handler.

Q4) The while loop is known as a(n)__________ loop because it tests the condition before performing an iteration.

Q5) A(n)___________ structure causes a set of statements to execute repeatedly.

To view all questions and flashcards with answers, click on the resource link above. Page 6

Chapter 5: Functions

Available Study Resources on Quizplus for this Chatper

66 Verified Questions

66 Flashcards

Source URL: https://quizplus.com/quiz/48076

Sample Questions

Q1) The code for a function is known as a function ___________.

Q2) The __________ design technique can be used to break down an algorithm into functions.

A) subtask

B) block

C) top-down

D) simplification

Q3) The function header marks the beginning of the function definition.

A)True

B)False

Q4) Arguments are passed by __________ to the corresponding parameter variables in a function.

Q5) What is a group of statements that exists within a program for the purpose of performing a specific task?

A) a function

B) a subtask

C) a process

D) a subprocess

Q6) The return values of the trigonometric functions in Python are in __________.

Q7) To refer to a function in a module,Python uses ___________ notation.

To view all questions and flashcards with answers, click on the resource link above. Page 7

Chapter 6: Files and Exceptions

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/48077

Sample Questions

Q1) Python allows the programmer to work with text and number files.

A)True

B)False

Q2) Which method could be used to strip specific characters from the end of a string?

A) estrip

B) rstrip

C) strip

D) remove

Q3) A(n)___________ block includes one or more statements that can potentially raise an exception.

Q4) When a program needs to save data for later use,it writes the data in a(n)___________.

Q5) An exception handler is a piece of code that is written using the try/except statement.

A)True

B)False

Q6) A filename __________ is a short sequence of characters that appear at the end of a filename,preceded by a period.

Q7) A(n)__________ file contains data that has not been converted to text.

To view all questions and flashcards with answers, click on the resource link above. Page 8

Chapter 7: Lists and Tuples

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/48078

Sample Questions

Q1) What is the first negative index in a list?

A) 0

B) -1

C) -0

D) the size of the list minus 1

Q2) The ___________ function can be used to convert a list to a tuple.

Q3) In order to create graphs using the matplotlib package,you need to import the pyplot module.

A)True

B)False

Q4) In order to create a graph in Python,you need to include

A) import matplotlib

B) import pyplot

C) import matplotlib.pyplot

D) import matplotlib

Import pyplot

Q5) Tuples are __________ sequences which means that once a tuple is created,it cannot be changed.

Q6) A(n)__________ is an object that holds multiple items of data.

Q7) A(n)___________ is a span of items that are taken from a sequence.

To view all questions and flashcards with answers, click on the resource link above. Page 9

Chapter 8: More About Strings

Available Study Resources on Quizplus for this Chatper

37 Verified Questions

37 Flashcards

Source URL: https://quizplus.com/quiz/48079

Sample Questions

Q1) You cannot use a for loop to iterate over the characters in a string.

A)True

B)False

Q2) The __________ method returns True if the string contains only numeric digits.

Q3) The following expression is valid: string[i] = 'i'

A)True

B)False

Q4) What is the first negative index in a string?

A) 0

B) -1

C) -0

D) the size of the string minus one

Q5) The __________ method returns a copy of the string with all the alphabetic letters converted to lower case.

Q6) Each character in a string has a(n)__________ which specifies its position in the string.

Q7) The __________ operator can be used to determine whether one string is contained in another string.

Q8) The __________ method returns the list of the words in a string.

To view all questions and flashcards with answers, click on the resource link above. Page 10

Chapter 9: Dictionaries and Sets

Available Study Resources on Quizplus for this Chatper

39 Verified Questions

39 Flashcards

Source URL: https://quizplus.com/quiz/48080

Sample Questions

Q1) The elements in a dictionary are not stored in a specific order. Therefore,a dictionary is not a(n)___________.

Q2) What is the number of the first index in a dictionary?

A) 0

B) 1

C) the size of the dictionary minus one

D) Dictionaries are not indexed by number.

Q3) The __________ method clears the contents of a dictionary.

Q4) The __________ of two sets is a set that contains all the elements of both sets.

Q5) Which method can be used to add a group of elements to a set?

A) add

B) addgroup

C) update

D) addset

Q6) Each element in a(n)__________ has two parts: a key and a value.

Q7) What does the get method do if the specified key is not found in the dictionary?

A) It throws an exception.

B) It does nothing.

C) It returns a default value.

D) You cannot use the get method to specify a key.

To view all questions and flashcards with answers, click on the resource link above. Page 11

Chapter 10: Classes and Object-Oriented Programming

Available Study Resources on Quizplus for this Chatper

38 Verified Questions

38 Flashcards

Source URL: https://quizplus.com/quiz/48081

Sample Questions

Q1) A method that returns a value from a class's attribute but does not change it is known as a(n)__________ method.

Q2) Object-oriented programming allows us to hide the object's data attributes from code that is outside the object.

A)True

B)False

Q3) Which method is automatically called when you pass an object as an argument to the print function?

A) __state__

B) __obj__

C) __str__

D) __init__

Q4) Which section in the UML holds the list of the class's data attributes?

A) first section

B) second section

C) third section

D) fourth section

Q5) The instance attributes are created by the __________ parameter and they belong to a specific instance of the class.

To view all questions and flashcards with answers, click on the resource link above. Page 12

Chapter 11: Inheritance

Available Study Resources on Quizplus for this Chatper

36 Verified Questions

36 Flashcards

Source URL: https://quizplus.com/quiz/48082

Sample Questions

Q1) Which of the following is the correct syntax for defining a class,table,which inherits from the furniture class?

A) class furniture[table]:

B) class table.furniture:

C) class furniture(table):

D) class table(furniture):

Q2) When a class inherits another class,it is required to use all the data attributes and methods of the superclass.

A)True

B)False

Q3) The __________ function determines whether or not an object is an instance of a specific class or an instance of a subclass of that class.

Q4) Given the following line of code,in a UML diagram,what would the open arrowhead point to?

Class Celery(Vegetable):

A) Celery

B) Vegetable

C) class

D) Celery(Vegetable)

To view all questions and flashcards with answers, click on the resource link above. Page 13

Chapter 12: Recursion

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/48083

Sample Questions

Q1) When,in a recursive solution,function A calls function B which,in turn,calls function A,this is known as indirect recursion.

A)True

B)False

Q2) Recursion is

A) never required to solve a problem

B) required to solve certain mathematical problems

C) sometimes required to solve string problems

D) required to solve some problems

Q3) A problem can normally be solved with recursion if it can be broken down into smaller problems that are identical in structure to the overall problem.

A)True

B)False

Q4) A function is called from the main function and then it calls itself five times. The depth of recursion is __________.

Q5) A base case is not necessary for all recursive algorithms.

A)True

B)False

Q6) Recursive function calls are __________ efficient than loops.

To view all questions and flashcards with answers, click on the resource link above. Page 14

Chapter 13: Gui Programming

Available Study Resources on Quizplus for this Chatper

42 Verified Questions

42 Flashcards

Source URL: https://quizplus.com/quiz/48084

Sample Questions

Q1) A(n)___________ is a container that can hold other widgets and organize the widgets in a window.

Q2) An info dialog box is a window that displays a message to the user and has an OK button which,when clicked,closes the dialog box.

A)True

B)False

Q3) Programs that use tkinter do not always run reliably in IDLE.

A)True

B)False

Q4) In a GUI environment most interactions are done through small windows known as __________ that display information and allow the user to perform actions.

A) input boxes

B) windows

C) dialog boxes

D) message boxes

Q5) The point (0,0)represents the same place in a window with the Canvas widget as with turtle graphics.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 15

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.