Programming Fundamentals Study Guide Questions - 489 Verified Questions

Page 1


Programming Fundamentals

Study Guide Questions

Course Introduction

Programming Fundamentals introduces students to the essential concepts and techniques of computer programming. Covering foundational topics such as variables, data types, control structures, functions, and basic algorithms, the course emphasizes logical problem solving and program design. Students will learn to write, test, and debug simple programs, develop algorithmic thinking skills, and gain familiarity with a high-level programming language. By the end of the course, students will have the skills necessary to approach more advanced programming topics and collaborate on software development projects.

Recommended Textbook

Starting Out with Python 2nd Edition by Tony Gaddis

Available Study Resources on Quizplus

14 Chapters

489 Verified Questions

489 Flashcards

Source URL: https://quizplus.com/study-set/895

Page 2

Chapter 1: Introduction to Computers and Programming

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) What type of volatile memory is usually used only for temporary storage while running a program?

A) ROM

B) TMM

C) RAM

D) TVM

Answer: C

Q2) The smallest storage location in a computer's memory is known as a _____.

A) byte

B) ketter

C) switch

D) bit

Answer: D

Q3) The following is an example of an instruction written in which computer language? 10110000

A) Assembly language

B) JAVA

C) Machine language

D) C #

Answer: C

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

Sample Questions

Q1) The output of the following print statement is: print 'I\'m ready to begin'

A) Im ready to begin

B) I\'m ready to begin

C) I'm ready to begin

D) 'I\'m ready to begin'

Answer: C

Q2) In a print statement, you can set the _____ argument to a space or empty string to stop the output from advancing to a new line.

A) stop

B) end

C) separator

D) newLine

Answer: B

Q3) A flowchart is a tool that programmers use to design programs.

A)True

B)False

Answer: True

Q4) The % symbol is the remainder operator and it is also known as the _______________ operator.

Answer: modulus

Page 4

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

Chapter 3: Simple functions

Available Study Resources on Quizplus for this Chatper

34 Verified Questions

34 Flashcards

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

Sample Questions

Q1) Arguments are passed by _______________ to the corresponding parameter variables in the function.

Answer: position

Q2) The top-down design breaks down the overall task of the program into a series of _______________.

Answer: subtasks

Q3) The value assigned to a global constant can be changed in the mainline logic. A)True

B)False

Answer: False

Q4) The approach called _______________ is taking a large task and dividing it into several smaller tasks that are easily performed.

Answer: divide and conquer

Q5) The main function contains a program's _______________ logic, which is the overall logic of the program.

Answer: mainline

Q6) In a flowchart, a function call is depicted by a(n) _______________ that has vertical bars.

Answer: rectangle

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

Chapter 4: Decision Structures and Boolean Logic

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) Multiple Boolean expressions can be combined by using a logical operator to create _____ expressions.

A) sequential

B) logical

C) compound

D) mathematical

Q2) What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8? not (x < y or z > x) and y < z

A) t

B) false

C) 8

D) 5

Q3) A(n) _______________ statement will execute one block of statements if its condition ist, or another block if its condition is false.

Q4) A Boolean variable can reference one of two values: _____.

A) yes or no

B) t or false

C) T or f

D) Y or N

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

Chapter 5: Repetition Structures

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) Which of the following represents an example to calculate the sum of the numbers (accumulator)?

A) total + number = total

B) number += number

C) total += number

D) total = number

Q2) Both of the following for clauses would generate the same number of loop iterations: for num in range(4): for num in range(1,5):

A)True

B)False

Q3) A better way to repeatedly perform an operation is to write the statements for the task once, and then place the statements in a loop that will repeat the statements as many times as necessary.

A)True

B)False

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

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

Chapter 6: Value-Returning functions and Modules

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) In a menu-driven program, a loop structure is used to determine the menu item the user selected.

A)True

B)False

Q2) Boolean functions are useful for simplifying complex conditions that are tested in decision and repetition structures.

A)True

B)False

Q3) The approach of _______________ makes the program easier to understand, test, and maintain.

Q4) The _______________ chart is an effective tool that programmers use for designing and documenting functions.

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

A)True B)False

Q6) The term _______________ is used to describe any mechanism that accepts input, performs some operation that cannot be seen, and produces output.

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

Chapter 7: files and Exceptions

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

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

A)True

B)False

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

A) Retrieving data

B) Reading data

C) Input data

D) Get data

Q3) Which of these is associated with a specific file and provides a way for the program to work with that file?

A) filename

B) Extension

C) file object

D) file variable

Q4) A(n) _______________ file contains data that has not been converted to text.

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

Q6) A(n) _______________ includes one or more statements that can potentially raise an exception.

Page 9

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

Chapter 8: Lists and Tuples

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) 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

Q2) The remove method removes all occurrences of the item from a list.

A)True

B)False

Q3) Lists are _______________, which means their elements can be changed.

Q4) The built-in function _______________ returns the length of a sequence.

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

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

Q7) The _______________ method is commonly used to add items to a list.

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

Chapter 9: More About Strings

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) Which method would you use to determine whether a substring is the suffix of a string?

A) endswith(substring)

B) find(substring)

C) replace(string, substring)

D) startswith(substring)

Q2) 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

Q3) The third number in string slicing brackets represents the _______________ value.

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

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

A) 0

B) -1

C) -0

D) Size of the string minus one

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

Chapter 10: Dictionaries and Sets

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) The union of two sets is a set that contains only the elements that appear in both sets.

A)True

B)False

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

A)True

B)False

Q3) Which of the following does not apply to sets?

A) The stored elements can be of different data types.

B) All the elements must be unique - no two elements can have the same value.

C) The elements are unordered.

D) The elements are pairs.

Q4) In a dictionary, you use a(n) _____ to locate a specific value.

A) datum

B) element

C) item

D) key

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

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

Chapter 11: Classes and Object-Oriented Programming

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) What is the special name given to the method that returns a string containing the object's state?

A) __state__

B) __obj__

C) __str__

D) __init__

Q2) What type of programming contains class definitions?

A) Procedural

B) Object

C) Object-oriented

D) Modular

Q3) The _______________ attributes are created by the self parameter and they belong to a specific instance of the class.

Q4) A class might be thought of as a 'blueprint' that an object may be created from.

A)True

B)False

Q5) A class _______________ is a set of statements that define a class's methods and data attributes.

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

Page 13

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

Chapter 12: Inheritance

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) The _______________ function determines whether an object is an instance of a specific class, or an instance of a subclass of that class.

Q2) What does a subclass inherit from a superclass?

A) Instances and attributes

B) Data and methods

C) Methods and instances

D) Attributes and methods

Q3) Which of the following is the correct syntax for defining a class dining which inherits from class furniture?

A) class furniture(dining)

B) class dining(furniture)

C) class furniture(dining):

D) class dining(furniture):

Q4) In an inheritance relationship, a television is a(n) _______________ of the electronics class.

Q5) When a subclass method has the same name as a superclass method, it is often said that the subclass method _______________ the superclass method.

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

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

Chapter 13: Recursion

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) If a recursive solution is evident for a particular problem, and the recursive algorithm does not slow system performance by an intolerable amount, then recursion would be a good design choice.

A)True

B)False

Q2) Recursive algorithms are more concise and efficient than iterative algorithms.

A)True

B)False

Q3) The base case does not require _______________, so it stops the chain of recursive calls.

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

Q5) A problem can be solved with recursion if it can be broken down into _____ problems.

A) smaller

B) one-line

C) manageable

D) modular

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

Page 15

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

Chapter 14: GUI Programming

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) The _____ accepts the user's commands.

A) register

B) CPU

C) operating system

D) ALU

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

A)True

B)False

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

Q4) _______________ are small windows that display information and allow the user to perform actions.

Q5) The _______________ widget is used to display text in a window.

Q6) In a GUI environment, no text input is possible.

A)True

B)False

Q7) To use the showinfo function, the tkinter.messagebox module needs to be imported. A)True

B)False

Page 16

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

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.