Introduction to Computer Science Review Questions - 488 Verified Questions

Page 1


Introduction to Computer Science Review

Questions

Course Introduction

Introduction to Computer Science provides students with a broad overview of the foundational concepts, principles, and tools that underpin the discipline of computer science. The course covers key topics such as algorithms, programming, data structures, computer systems, and the societal impact of computing. Students will learn to think computationally, develop problem-solving skills, and gain hands-on experience with coding by working on practical programming assignments and projects. This course serves as a fundamental stepping stone for further study in computer science and related fields, engaging students with real-world applications and the relevance of computing in modern society.

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 instruction set for a microprocessor is unique and is typically understood only by the microprocessors of the same brand.

A)True

B)False

Answer: True

Q2) The disadvantages of a(n) _______________ are that it only holds small amounts of data, is slow to access data, and can be unreliable.

Answer: Floppy disk

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

Answer: hardware

Q4) The _______________ is the part of a computer that actually runs programs and is the most important component in a computer.

Answer: central processing unit or CPU

Q5) The CPU understands instructions written in a binary machine language. A)True

B)False

Answer: True

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) Python allows programmers to break a statement into multiple lines.

A)True

B)False

Answer: True

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

Q3) What is the output of the following print statement?

Print('The path is D:\\sample\\test.')

A) 'The path is D:\\sample\\test.'

B) The path is D:\\sample\\test.

C) The path is D\\sample\\test.

D) The path is D:\sample\test.

Answer: D

Q4) The result of the expression 12.3 + 6.7 is _______________.

Answer: 19.0

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

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) The logical _______________ operator reverses the truth of a Boolean expression.

Answer: not

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

Answer: if-else

Q3) A(n) _____ structure is a logical design that controls the order in which a set of statements execute.

A) function

B) control

C) sequence

D) iteration

Answer: B

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

A)True

B)False

Answer: False

Q5) Expressions that are tested by the if statement are called Boolean expressions.

A)True

B)False

Answer: True

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) Functions can be called from statements in the body of a loop, and loops can be called from the body of a function.

A)True

B)False

Q2) What is the disadvantage of coding in one long sequence structure?

A) Duplicated code makes the program faster to write.

B) Writing a long sequence of statements is error prone.

C) If parts of the duplicated code have to be corrected, the correction has to be made many times.

D) It does not make use of decision structures.

Q3) The first input operation is called the _____, and its purpose is to get the first input value that will be tested by the validation loop.

A) priming read

B) first input

C) loop set read

D) loop validation.

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

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

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) What type of value is returned by the functions random and uniform?

A) integer

B) number

C) float

D) double

Q2) The _____ of a local variable is the function in which the variable is created.

A) global

B) defined

C) local

D) scope

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

Q4) Python allows for passing multiple arguments to a function.

A)True

B)False

Q5) A variable is visible only to statements in the variable's _______________.

Q6) The randrange function returns a randomly selected value from a specific sequence of numbers.

A)True

B)False

Page 7

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) Python allows the programmer to work with text and number files.

A)True

B)False

Q2) The term _______________ file is used to describe a file to which data is written.

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

A)True

B)False

Q4) How many types of files are there?

A) One

B) Two

C) Three

D) Four

Q5) Programmers usually refer to the process of _______________ data in a file as "writing data to" the file.

Q6) The term _______________ file is used to describe a file from which the program gets data.

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

Page 8

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

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) The built-in function _______________ returns the length of a sequence.

Q2) Indexing starts at 1, so the index of the first element is 1, the index of the second element is 2, and so forth.

A)True

B)False

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

A) 0

B) -1

C) -0

D) Size of the string or list minus one

Q4) What would be the value of the variable list after the execution of the following code?

List = [1, 2]

List = list * 3

A) [1, 2] * 3

B) [3, 6]

C) [1, 2, 1, 2, 1, 2]

D) [[1, 2], [1, 2], [1, 2]]

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

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

35 Verified Questions

35 Flashcards

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

Sample Questions

Q1) The _______________ method returns true if the string contains only numeric digits.

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

Q3) The _______________ method returns the list of the words in the string.

Q4) The strip() method returns a copy of the string with all leading whitespace characters removed, but does not remove trailing whitespace characters.

A)True

B)False

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

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

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) The set remove and discard methods behave differently only when a specified item is not found in the set.

A)True

B)False

Q2) What would be the result of the following code?

Ages = {'Aaron' : 6, 'Kelly' : 3, 'Abigail' : 1 }

Value = ages['Brianna']

A) false

B) -1

C) 0

D) KeyError

Q3) The index of the first key-value pair in a dictionary is 0.

A)True

B)False

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

A) del

B) remove

C) delete

D) unpair

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

Q2) What is another name for the accessor methods?

A) Setters

B) Getters

C) Instances

D) Attributes

Q3) In _______________ programming, the programming is centered on objects that are created from abstract data types that encapsulate data and functions together.

Q4) A(n) _______________ is code that specifies the data attributes and methods for a particular type of object.

Q5) A class might be thought of as a 'blueprint' that an object may be created from. 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) The _______________ function determines whether an object is an instance of a specific class, or an instance of a subclass of that class.

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) Base classes are also called _____.

A) superclasses

B) derived

C) subclasses

D) classes

Q4) In an inheritance relationship, what is a specialized class called?

A) Superclass

B) Subclass

C) Object

D) Method

Q5) In an inheritance relationship, the extended class is called the _______________.

Q6) _______________ is used to create an 'is a' relationship among classes.

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 defines the depth of recursion?

A) The length of the algorithm

B) The numbers of function calls

C) The number of times the function calls itself

D) The number of times it goes back to the main function

Q2) Recursive functions are _____ iterative algorithms.

A) more efficient than B) less efficient than C) as efficient as D) incomparable to

Q3) A function is called from the main function for the first time. It then calls itself seven times. What is the depth of recursion?

A) Eight

B) Two

C) One

D) Seven

Q4) A recursive function must have some way to control the number of times it repeats. A)True

B)False

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) In a GUI environment, no text input is possible.

A)True

B)False

Q2) Which widget will create a rectangular area that can be used to display graphics?

A) Label

B) Frame

C) Canvas

D) Message

Q3) The Toplevel widget is a container, like a(n) _____, but displays in its own window.

A) Label

B) Frame

C) Canvas

D) Message

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

A)True

B)False

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

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