Programming Fundamentals Practice Exam - 533 Verified Questions

Page 1


Programming Fundamentals

Practice Exam

Course Introduction

Programming Fundamentals introduces students to the core concepts and techniques of computer programming. The course covers the basics of algorithms, data types, control structures, functions, and basic input/output operations, primarily using a high-level programming language. Emphasis is placed on problem-solving skills, logical thinking, debugging, and understanding how programs are structured and executed. Students will complete hands-on assignments and projects to develop the practical skills needed to design, write, and test simple computer programs, forming a solid foundation for further study in computer science and software development.

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) Which computer language uses short words known as mnemonics for writing programs?

A) Assembly

B) Java

C) Pascal

D) Visual Basic

Answer: A

Q2) USB drives store data using __________ memory.

Answer: flash

Q3) The Python language uses a compiler which is a program that both translates and executes the instructions in a high-level language.

A)True

B)False

Answer: False

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

Answer: script

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

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

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) What is the informal language,used by programmers use to create models of programs,that has no syntax rules and is not meant to be compiled or executed?

A) flowchart

B) algorithm

C) source code

D) pseudocode

Answer: D

Q2) After the execution of the following statement,the variable price will reference the value __________.

Price = int(68.549)

A) 68

B) 69

C) 68.55

D) 68.6

Answer: A

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

Answer: escape

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

4

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) A(n)___________ expression is made up of two or more Boolean expressions. Answer: compound

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

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

Answer: conditionally

Q4) In flowcharting,the __________ symbol is used to represent a Boolean expression. Answer: diamond

Q5) The logical __________ operator reverses the truth of a Boolean expression. Answer: not

Q6) Boolean variables are commonly used as __________ to indicate whether a specific condition exists.

Answer: flags

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) A(n)__________-controlled loop causes a statement or set of statements to repeat as long as the condition is true.

Q2) In a nested loop,the inner loop goes through all of its iterations for each iteration of the outer loop.

A)True

B)False

Q3) The integrity of a program's output is only as good as the integrity of its input. For this reason,the program should discard input that is invalid and prompt the user to enter valid data.

A)True

B)False

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

Q5) The first line in a while loop is referred to as the condition clause. A)True B)False

Q6) The ___________ function is a built-in function that generates a list of integer values.

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) A value-returning function is

A) a single statement that performs a specific task

B) called when you want the function to stop

C) a function that will return a value back to the part of the program that called it

D) a function that receives a value when called

Q2) In Python you can have a list of variables on the left side of the argument operator.

A)True

B)False

Q3) The ___________ chart is an effective tool used by programmers to design and document functions.

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

Q5) A(n)__________ is a variable that receives an argument that is passed into a function.

A) global variable

B) argument

C) named constant D) parameter

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) When data is written to a file,it is described as a(n)__________ file.

Q2) Which method could be used to convert a numeric value to a string?

A) str

B) value

C) num

D) chr

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

Q4) In Python,there is nothing that can be done if the program tries to access a file to read that does not exist.

A)True

B)False

Q5) Which method will return an empty string when it has attempted to read beyond the end of a file?

A) read

B) getline

C) input

D) readline

Q6) 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 will be the value of the variable list after the following code executes?

List = [1,2,3,4]

List[3] = 10

A) [1, 2, 3, 10]

B) [1, 2, 10, 4]

C) [1, 10, 10, 10]

D) Nothing; this code is invalid

Q2) Lists are ___________,which means their elements can be changed in a program.

Q3) Which method can be used to place an item at a specific index in a list?

A) append

B) index

C) insert

D) add

Q4) Which method can be used to convert a list to a tuple?

A) append

B) tuple

C) insert

D) list

Q5) The __________ method reverses the order of the items in a list.

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

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

37 Verified Questions

37 Flashcards

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

Sample Questions

Q1) When the operand on the left side of the * symbol is a string and the operand on the right side is an integer,the * becomes the ___________ operator.

Q2) What will be assigned to the variable s_string after the following code executes?

Special = '1357 Country Ln.'

S_string = special[ :4]

A) '7'

B) '1357'

C) 5

D) '7 Country Ln.'

Q3) What will be assigned to the variable some_nums after the following code executes?

Special = '0123456789'

Some_nums = special[0:10:2]

A) '0123456789'

B) '24682468'

C) '02468'

D) '02020202020202020202'

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

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

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) In order to avoid KeyError exceptions,you can check whether a key is in the dictionary using the __________ operator.

A) included B) in C) isnotin D) isin

Q2) To add a single item to a set,you can use the set __________ method.

Q3) Which would you use to delete an existing key-value pair from a dictionary?

A) del

B) remove C) delete D) unpair

Q4) Sets are created using curly braces { }.

A)True B)False

Q5) To write an object to a file,you use the __________ function of the __________ module.

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

Q7) Each element in a dictionary view is a __________.

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

Q8) The __________ method returns all of a dictionary's keys as a dictionary view.

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) What does the acronym UML stand for?

A) Unified Modeling Language

B) United Modeling Language

C) Unified Model Language

D) Union of Modeling Languages

Q2) All instances of a class share the same values of the data attributes in the class.

A)True

B)False

Q3) An object's __________ contains the values of the object's attributes at a given moment.

Q4) ___________ provides a set of standard diagrams for graphically depicting object-oriented systems.

Q5) In object-oriented programming,one of first tasks of the programmer is to

A) list the nouns in the problem

B) list the methods that are needed

C) identify the classes needed

D) identify the objects needed

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

Q7) Each object that is created from a class is called a(n)__________ of the class.

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

36 Verified Questions

36 Flashcards

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

Sample Questions

Q1) __________ has the ability to define a method in a subclass and then define a method with the same name in a superclass.

A) Inheritance

B) Encapsulation

C) Polymorphism

D) the 'is a' relationship

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

Q3) In a UML diagram,what does the open arrowhead point to?

A) the superclass

B) the subclass

C) the object

D) a method

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

Q5) In an inheritance relationship,a minivan can be thought of as a(n)___________ of the vehicles class.

Q6) In a UML diagram,a line with an open arrowhead from a subclass to a superclass indicates ___________.

Page 13

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

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) Recursive function calls are __________ efficient than loops.

Q2) Recursion is sometimes required to solve certain types of problems.

A)True

B)False

Q3) Usually a problem solved by recursion is reduced by making the value of one or more parameters __________ with each recursive call.

Q4) What is the second step to take 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 use recursion to solve the problem in all circumstances which cannot be solved without recursion.

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

D) Identify a way to stop the recursion.

Q5) Recursive algorithms are always more concise and efficient than iterative algorithms.

A)True

B)False

Q6) The majority of repetitive programming tasks are best done with ___________.

Q7) Some problems are more __________ solved with recursion than with a loop.

Page 14

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

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

Q2) Which of the following must you include with your program so you can display a message to the user with the showinfo function?

A) import tkinter

B) import canvas

Import messagebox

C) import messagebox

D) import tkinter

Import tkinter.messagebox

Q3) The __________ module allows you to create GUI programs in Python.

Q4) The __________ widget provides methods that allow the programmer to draw some simple shapes.

Q5) The GUI popularized the use of the __________ as an input device.

Q6) The __________ widget is used to display text in a window.

Q7) A(n)__________ allows the user to interact with the operating system and other programs through graphical elements on the screen.

Page 15

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

Turn static files into dynamic content formats.

Create a flipbook