Programming Logic and Design Exam Bank - 488 Verified Questions

Page 1


Programming Logic and Design Exam Bank

Course Introduction

Programming Logic and Design introduces students to the fundamental principles of problem-solving and algorithm development in computer programming. The course emphasizes structured logic techniques, including the use of flowcharts, pseudocode, and control structures such as sequence, selection, and iteration. Students will learn to analyze problems, design step-by-step solutions, and translate these solutions into logical procedures that can be converted into actual computer code. By focusing on language-independent concepts, this course builds a strong foundation for future programming studies and helps students develop clear and efficient approaches to software development.

Recommended Textbook

Starting Out with Python 3rd Edition by Tony Gaddis

Available Study Resources on Quizplus

13 Chapters

488 Verified Questions

488 Flashcards

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

Chapter 1: Introduction to Computers and Programming

Available Study Resources on Quizplus for this Chatper

36 Verified Questions

36 Flashcards

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

Sample Questions

Q1) The process known as the _____ cycle is used by the CPU to execute instructions in a program.

A) decode-fetch-execute

B) decode-execute-fetch

C) fetch-decode-execute

D) fetch-execute-decode

Answer: C

Q2) In _______________ mode, the interpreter reads the contents of a file that contains Python statements and executes each statement.

Answer: script

Q3) A _____ has no moving parts, and operates faster than a traditional disk drive.

A) DVD drive

B) solid state drive

C) floppy disk

D) hyper drive

Answer: B

Q4) The term _______________ refers to all of the physical devices that a computer is made of.

Answer: hardware

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

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) A(n) _______________ character is a special character that is preceded with a backslash, appearing inside a string literal.

Answer: escape

Q2) In Python, print statements written on separate lines do not necessarily output on separate lines.

A)True

B)False

Answer: True

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

Answer: software requirement

Q4) After the execution of the following statement, the variable sold will reference the numeric literal value as a(n) _____ data type: sold = 256.752

A) int

B) float

C) str

D) currency

Answer: B

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

Chapter 3: Decision Structures and Boolean Logic

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8?

X < y and z > x

A) true

B) false C) 8

D) 5

Answer: B

Q2) A(n) _______________ expression is made up of two or more Boolean expressions.

Answer: compound

Q3) Which logical operators perform short-circuit evaluation?

A) or, not B) not, and C) or, and D) and, or, not

Answer: C

Q4) Python provides a special version of a decision structure known as the _______________ statement, which makes the logic of the nested decision structure simpler to write.

Answer: if-elif-else

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

34 Verified Questions

34 Flashcards

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

Sample Questions

Q1) The first line in the while loop is referred to as the condition clause.

A)True

B)False

Q2) _____ is the process of inspecting data that has been input to a program to make sure it is valid before it is used in a computation.

A) Input validation

B) Correcting data

C) Data validation

D) Correcting input

Q3) In a nested loop, the inner loop goes through all of its iterations for every single iteration of an outer loop.

A)True

B)False

Q4) A(n) _______________ validation loop is sometimes called an error trap or an error handler.

Q5) In Python, an infinite loop usually occurs when the computer accesses the wrong memory address.

A)True

B)False

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

Chapter 5: Functions and Modules

Available Study Resources on Quizplus for this Chatper

69 Verified Questions

69 Flashcards

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

Sample Questions

Q1) One of the reasons not to use global variables is that it makes a program hard to debug.

A)True B)False

Q2) Which of the following functions returns the largest integer that is less than or equal to x?

A) floor B) ceil

C) lesser D) greater

Q3) In Python, one can have a list of variables on the left side of the assignment operator.

A)True

B)False

Q4) The math function, ceil(x), returns the smallest integer that is greater than or equal to x.

A)True B)False

Q5) Functions in the standard library are stored in files that are known as

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

Chapter 6: Files and Exceptions

Available Study Resources on Quizplus for this Chatper

34 Verified Questions

34 Flashcards

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

Sample Questions

Q1) Which step creates a connection between a file and a program?

A) Open the file.

B) Read the file.

C) Process the file.

D) Close the file.

Q2) The ZeroDivisionError exception is raised when the program attempts to perform a division by zero.

A)True

B)False

Q3) What do you call the process of retrieving data from a file?

A) Retrieving data

B) Reading data

C) Input data

D) Get data

Q4) When a piece of data is read from a file, it is copied from the file into the program. A)True

B)False

Q5) A(n) _______________ gives information regarding the line number(s) that caused an exception.

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

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) What method can be used to convert a list to a tuple?

A) append

B) tuple

C) insert

D) list

Q2) What would be the value of the variable list2 after the execution of the following code?

List1 = [1, 2, 3]

List2 = []

For element in list1

List2.append(element)

List1 = [4, 5, 6]

A) [1, 2, 3]

B) [4, 5, 6]

C) [1, 2, 3, 4, 5, 6]

D) invalid code

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

Q4) Each element in a tuple has a(n) _______________ that specifies its position in the tuple.

Page 9

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

Chapter 8: More About Strings

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) Indexing of a string starts at 1, so the index of the first character is 1, the index of the second character is 2, and so forth.

A)True

B)False

Q2) What is the return value of the string method lstrip()?

A) The string with all whitespace removed

B) The string with all leading spaces removed

C) The string with all leading tabs removed

D) The string with all leading whitespaces removed

Q3) An expression of the form string[i] = 'i' is a valid expression.

A)True

B)False

Q4) What will be assigned to the string variable even after the execution of the following code?

Special = '0123456789'

Even = special[0:10:2]

A) '13579'

B) '2468'

C) '02468'

D) Invalid code

Page 10

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

Chapter 9: Dictionaries and Sets

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) Which function would you use to get the number of elements in a dictionary?

A) size

B) length

C) len

D) invalid code

Q2) A dictionary can include the same value several times, but cannot include the same key several times.

A)True

B)False

Q3) The _______________ of two sets is a set that contains all the elements of both sets.

Q4) What method can be used to add a group of elements to a set?

A) add

B) addgroup

C) update

D) Elements must be added one at a time.

Q5) To add a single item to a set, you can use the set method _______________.

Q6) You would typically use a for loop to iterate over the elements in a set.

A)True

B)False

Page 11

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

Chapter 10: Classes and Object Oriented Programming

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) An object's _______________ is simply the values of the object's attributes at any given moment.

Q2) What is, conceptually, a self-contained unit that consists of data attributes and methods that operate on the data attributes?

A) Class

B) Object

C) Instance

D) Module

Q3) What is another name for the mutator methods?

A) Setters

B) Getters

C) Instances

D) Attributes

Q4) _______________ programming is a method of writing software that centers on the actions that take place in a program.

Q5) Procedures operate on data items that are separate from the procedures.

A)True

B)False

Q6) A(n) _______________ method in a class initializes an object's data attributes.

Page 12

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

Chapter 11: Inheritance

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) In the following line of code, what is the name of the base class?

Class Male(Human):

A) Male

B) Human

C) Either

D) Incorrect code

Q2) _______________ allows subclasses to have methods with the same names as methods in their superclasses.

Q3) What gives a program the ability to call the correct method depending on the type of object that is used to call it?

A) Polymorphism

B) Inheritance

C) Encapsulation

D) Methods

Q4) The term _______________ refers to an object's ability to take different forms.

Q5) A superclass inherits attributes and methods from its subclasses without any of them having to be rewritten.

A)True

B)False

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/20932

Sample Questions

Q1) What is referred to as the recursive case?

A) At least one case in which the problem can be solved without recursion

B) A way to solve the problem in all other circumstances using recursion

C) The way to stop the recursion

D) The way to return to the main function

Q2) If the problem can be solved immediately without recursion, then the recursive function _____.

A) solves it and returns

B) Exits

C) returns the result

D) generates a run-time error

Q3) What is the first step that needs to be taken in order to apply a recursive approach?

A) Identify at least one case in which the problem can be solved without recursion.

B) Determine a way to solve the problem in all other circumstances using recursion.

C) Identify a way to stop the recursion.

D) Determine a way to return to the main function.

Q4) Some problems are _______________ solved with recursion than with a loop.

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

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) Programs that use tkinter do not always run reliably under IDLE.

A)True

B)False

Q2) With what part of the computer does the user interact?

A) Graphical unit

B) User interface

C) Register

D) CPU

Q3) Python does not have GUI programming features built into the language itself.

A)True

B)False

Q4) A root widget's destroy method can be used as a callback function for a quit button.

A)True

B)False

Q5) A(n) _______________ function is a function or method that executes when the user clicks the button.

Q6) The GUI popularized the use of the _______________ as an input device.

Q7) A(n) _______________ is a widget that the user can click to cause an action to occur.

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.