Skip to main content

Computer Science I Study Guide Questions - 949 Verified Questions

Page 1


Computer Science I Study Guide Questions

Course Introduction

Computer Science I is an introductory course that provides a foundation in fundamental computer science concepts, with a primary focus on problem-solving through programming. Students will learn core programming constructs such as variables, control structures, functions, data types, and basic algorithms, typically using a high-level programming language like Python or Java. The course also introduces essential concepts such as debugging, software design, and computational thinking, setting the stage for advanced studies in computer science. Through hands-on projects and assignments, students develop both their programming skills and their ability to analyze and solve problems systematically.

Recommended Textbook

Starting Out with C++ from Control Structures to Objects 9th Edition by Tony Gaddis

Available Study Resources on Quizplus

21 Chapters

949 Verified Questions

949 Flashcards

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

Chapter 1: Introduction to Computers and Programming

Available Study Resources on Quizplus for this Chatper

47 Verified Questions

47 Flashcards

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

Sample Questions

Q1) A model often used when creating a program that begins with the overall task and refines it into smaller subtasks is a(n)

A) flowchart

B) UML diagram

C) blueprint

D) hierarchy chart

E) None of these

Answer: D

Q2) Which of the following best describes an operator?

A) An operator is a rule that must be followed when constructing a program.

B) An operator allows you to perform operations on one or more pieces of data.

C) An operator marks the beginning or ending of a statement, or is used to separate items in a list.

D) An operator is a word that has a special meaning.

E) An operator is a symbolic name that refers to a variable.

Answer: B

Q3) Programs are often referred to as hardware.

A)True

B)False

Answer: False

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

Chapter 2: Introduction to C

Available Study Resources on Quizplus for this Chatper

62 Verified Questions

62 Flashcards

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

Sample Questions

Q1) Which of the following statements correctly defines a named constant named TAX_RATE that holds the value 0.075?

A) double TAX_RATE = 0.075; B) const TAX_RATE; Double TAX_RATE = 0.075; C) const double TAX_RATE = 0.075; D) double TAX_RATE; Const TAX_RATE = 0.075; E) const TAX_RATE = 0.075;

Answer: C

Q2) Which of the following lines must be included in a program that has string variables?

A) #include (string class)

B) #include namespace std; C) #include <string> D) string var;

E) None of these Answer: C

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

4

Chapter 3: Expressions and Interactivity

Available Study Resources on Quizplus for this Chatper

45 Verified Questions

45 Flashcards

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

Sample Questions

Q1) Which of the following statements will read an entire line of input into the string object, address?

A) cin << address;

B) cin address;

C) cin.get(address);

D) getline(cin, address);

E) cin.get(length >> width >> height);

Answer: D

Q2) This manipulator causes the field to be left justified with padding spaces printed to the right:

A) left_justify

B) right

C) left

D) left_pad

E) None of these

Answer: C

Q3) The fixed manipulator causes a number to be displayed in scientific notation.

A)True

B)False

Answer: False

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

Chapter 4: Making Decisions

Available Study Resources on Quizplus for this Chatper

51 Verified Questions

51 Flashcards

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

Sample Questions

Q1) When a relational expression is False, it has the value

A) 1

B) 0

C) 0, 1, or -1

D) -1

E) None of these

Q2) If the expression on the left side of the following is False, the expression on the right side will not be checked.

(a > = b) && (c == d)

A)True

B)False

Q3) When an if statement is placed within the conditionally-executed code of another if statement, this is known as

A) complexity

B) overloading

C) nesting

D) validation

E) None of these

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

Chapter 5: Loops and Files

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) What will the following code display?

Int number = 6;

Cout << ++number << endl;

A) 6

B) 5

C) 7

D) 0

Q2) The condition that is tested by a while loop must be enclosed in parentheses and terminated with a semicolon.

A)True

B)False

Q3) In the following statement, which operator is used first?

While (x++ < 10)

A) ++

B) <

C) neither; the expression is invalid

D) cannot tell without the rest of the code

Q4) An output file is a file that data is written to.

A)True

B)False

Page 7

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

Chapter 6: Functions

Available Study Resources on Quizplus for this Chatper

49 Verified Questions

49 Flashcards

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

Sample Questions

Q1) This is a dummy function that is called instead of the actual function it represents:

A) main

B) stub

C) a driver

D) an overloaded function

Q2) When used as parameters, these types of variables allow a function to access the parameter's original argument:

A) reference

B) floating-point

C) counter

D) undeclared

E) None of these

Q3) One reason for using functions is to break programs into manageable units or modules.

A)True

B)False

Q4) Global variables are initialized to zero by default.

A)True

B)False

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

Chapter 7: Arrays and Vectors

Available Study Resources on Quizplus for this Chatper

56 Verified Questions

56 Flashcards

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

Sample Questions

Q1) What will the following code display?

Int numbers[] = {99, 87, 66, 55, 101};

For (int i = 1; i < 4; i++)

Cout << numbers[i] << " ";

A) 99 87 66 55 101

B) 87 66 55 101

C) 87 66 55

D) Nothing. This code has an error.

Q2) Given the following declaration, where is the value 77 stored in the scores array?

Int scores[] = {83, 62, 77, 97, 86}

A) scores[0]

B) scores[1]

C) scores[2]

D) scores[3]

E) scores[5]

Q3) Although two-dimensional arrays are a novel idea, there is no known way to pass one to a function.

A)True

B)False

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

Chapter 8: Searching and Sorting Arrays

Available Study Resources on Quizplus for this Chatper

30 Verified Questions

30 Flashcards

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

Sample Questions

Q1) A selection sort and a binary search can be applied to STL vectors as well as arrays.

A)True

B)False

Q2) Array elements must __________ before a binary search can be performed.

A) summed

B) set to zero

C) positive integers

D) sorted

E) None of these

Q3) Before you can perform a selection sort, the data must be stored in ascending order.

A)True

B)False

Q4) If you are using the bubble sort algorithm to sort an array in descending order, the smaller values move toward the end.

A)True

B)False

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

10

Chapter 9: Pointers

Available Study Resources on Quizplus for this Chatper

47 Verified Questions

47 Flashcards

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

Sample Questions

Q1) The unique_ptr is the sole owner of a piece of dynamically allocated memory.

A)True

B)False

Q2) If you are using an older computer that does not support the C++11 standard, you should initialize pointers with

A) the integer 0 or the value NULL

B) the null terminator '\0'

C) a nonzero value

D) Any of these

E) None of these

Q3) The __________, also known as the address operator, returns the memory address of a variable.

A) asterisk (* )

B) ampersand ( & )

C) percent sign ( % )

D) exclamation point ( ! )

E) None of these

Q4) In C++11, the nullptr keyword was introduced to represent the address 0.

A)True

B)False

Page 11

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

Chapter 10: Characters, C-Strings, and More About the String Class

Available Study Resources on Quizplus for this Chatper

47 Verified Questions

47 Flashcards

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

Sample Questions

Q1) Which of the following statements appropriately defines a C-string that stores names of up to 25 characters?

A) char name[25];

B) string name[25];

C) char name[26];

D) string name[24];

E) None of these

Q2) To use the strlen function in a program you must include

A) #include&lt;strlen&gt;

B) #include&lt;iostring&gt;

C) #include&lt;cstring&gt;

D) #include&lt;stringlib&gt;

E) None of these

Q3) Which of the following will return true if the argument is a printable character other than a digit, letter, or space?

A) isprint

B) ispunct

C) ischar

D) isnotdls

E) None of these

12

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

Chapter 11: Structured Data

Available Study Resources on Quizplus for this Chatper

46 Verified Questions

46 Flashcards

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

Sample Questions

Q1) Before a structure can be used it must be

A) declared

B) dereferenced

C) initialized

D) All of these

E) None of these

Q2) Passing a structure as a constant reference parameter to a function

A) can potentially result in changes to the structure's members

B) guarantees not to result in changes to the structure's members

C) will always change the structure's members

D) None of these

Q3) Which of the following describes only the general characteristics of an object?

A) initialization

B) abstraction

C) detailed specification

D) initiation

E) None of these

Q4) Structure variables may be passed as arguments to functions.

A)True

B)False

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

Chapter 12: Advanced File Operations

Available Study Resources on Quizplus for this Chatper

38 Verified Questions

38 Flashcards

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

Sample Questions

Q1) By default, files are opened in binary mode.

A)True

B)False

Q2) Which of the following means accessing information from a file non-sequentially?

A) linear access

B) incremented acces

C) random access

D) protected access

E) None of these

Q3) ofstream, ifstream, and fstream are

A) header files

B) libraries

C) data types

D) string arrays

E) None of these

Q4) Only one file stream object can be declared per C++ program.

A)True

B)False

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

Page 14

Chapter 13: Introduction to Classes

Available Study Resources on Quizplus for this Chatper

54 Verified Questions

54 Flashcards

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

Sample Questions

Q1) In C++11 you can have one constructor call another constructor in the same class by using

A) constructor delegation

B) in-place initialization

C) a member initialization list

D) None of these

Q2) If you do not declare a destructor function, the compiler will furnish one automatically.

A)True

B)False

Q3) Constructor functions are often used to allocate memory that will be needed by the object.

A)True

B)False

Q4) Which of the following is used to protect important data?

A) the public access specifier

B) the private access specifier

C) the protect member function

D) the class protection operator, @

E) None of these

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

Chapter 14: More About Classes

Available Study Resources on Quizplus for this Chatper

46 Verified Questions

46 Flashcards

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

Sample Questions

Q1) Select all that apply. Given the following code fragment, which of the things shown below happen when the statement on line 8 executes?

1 int square(int a)

2 {

3 \(\quad\)return a * a;

4 }

5 int main()

6 {

7 \(\quad\)int x = 0;

8 \(\quad\)x = square(5);

9 \(\quad\)cout << x << endl;

10\(\quad\)return 0;

11 }

A) The square function is called and the value 5 is passed as an argument.

B) The square function calculates 5*5 and stores the result, 25, as a temporary value.

C) The temporary value is copied (assigned) to the variable x.

D) The temporary value is discarded by the system.

E) None of these

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

16

Chapter 15: Inheritance, Polymorphism, and Virtual Functions

Available Study Resources on Quizplus for this Chatper

43 Verified Questions

43 Flashcards

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

Sample Questions

Q1) Pointers to a base class may be assigned the address of a derived class object. A)True

B)False

Q2) In C++11, using constructor inheritance, it is possible for any of the base class's constructors to be inherited.

A)True

B)False

Q3) A virtual function is a function that expects to be __________ in a derived class. A) ignored

B) called frequently C) overridden D) private

E) None of these

Q4) When arguments must be passed to the base class constructor, they are passed from the derived class constructor's header line.

A)True

B)False

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

Chapter 16: Exceptions and Templates

Available Study Resources on Quizplus for this Chatper

36 Verified Questions

36 Flashcards

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

Sample Questions

Q1) Given the following code, what will happen if the value of denom is 0? double divide(int numer, int denom)

{ if (denom == 0)

\(\quad\)throw "ERROR: Cannot divide by zero.\n"; else

\(\quad\)Return static_cast&lt;double&gt;(numer)/denom; }

A) Nothing will happen because there is no catch block.

B) The program will display ERROR: Cannot divide by zero.and then move to the statement following the if/else block.

C) The program will display ERROR: Cannot divide by zero.and then halt.

D) There is no throw point because there is no try block.

E) None of these

Q2) The try/catch/throw construct is able to handle only one type of exception in a try block.

A)True

B)False

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

18

Chapter 17: The Standard Template Library

Available Study Resources on Quizplus for this Chatper

38 Verified Questions

38 Flashcards

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

Sample Questions

Q1) A(n) __________ is a class that stores data and organizes it in some fashion.

A) iterator

B) container

C) template

D) box

E) None of these

Q2) A vector is an associative container that works like an array but is dynamic in size.

A)True

B)False

Q3) The algorithms provided by the STL are implemented as __________ and perform various operations on elements of containers.

A) virtual functions

B) function templates

C) global variables

D) private data members

E) None of these

Q4) A set is an associative container containing elements that must all be unique.

A)True

B)False

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

Chapter 18: Linked Lists

Available Study Resources on Quizplus for this Chatper

41 Verified Questions

41 Flashcards

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

Sample Questions

Q1) To build a list initally, you can use a(n) __________ routine.

A) build

B) append

C) constructor

D) initialization

E) None of these

Q2) To append a node to a list means to

A) delete a node from the beginning of the list

B) delete a node from the end of the list

C) add a node to the beginning of the list

D) add a node to the end of the list

E) None of these

Q3) Select all that apply. Variations of the linked list are

A) doubly linked list

B) circular linked list

C) frontward linked list

D) backward linked list

Q4) The Standard Template Library (STL) provides a linked list container.

A)True

B)False

Page 20

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

Chapter 19: Stacks and Queues

Available Study Resources on Quizplus for this Chatper

47 Verified Questions

47 Flashcards

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

Sample Questions

Q1) Given the following code, assume the myQueue object is a queue that can hold integers and that value is an int variable. 1 myQueue.enqueue(0);

2 myQueue.enqueue(1);

3 myQueue.enqueue(2);

4 myQueue.dequeue(value);

5 myQueue.dequeue(value);

6 myQueue.dequeue(value);

7 cout << value << endl;

Assume that the dequeue function, called on lines 4, 5, and 6, stores the number removed from the queue in the value variable. What will the statement on line 7 display?

A) 0

B) 1

C) 2

D) None of these

Q2) A stack that is implemented as a linked list is known as a deque.

A)True

B)False

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

21

Chapter 20: Recursion

Available Study Resources on Quizplus for this Chatper

27 Verified Questions

27 Flashcards

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

Sample Questions

Q1) A recursive function cannot call another function.

A)True

B)False

Q2) The QuickSort algorithm was developed in 1960 by

A) Bjarne Stroustrup

B) Tony Gaddis

C) C.A.R. Hoare

D) C.M. Turner

E) None of these

Q3) A problem can be solved with recursion if it can be broken down into successive smaller problems that are the same as the overall problem.

A)True

B)False

Q4) The __________ of recursion is the number of times a recursive function calls itself.

A) level

B) breadth

C) type

D) depth

E) None of these

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

Chapter 21: Binary Trees

Available Study Resources on Quizplus for this Chatper

39 Verified Questions

39 Flashcards

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

Sample Questions

Q1) The InOrder method of traversing a binary tree involves traversing the node's left subtree, processing the node's data, and then traversing the node's right subtree.

A)True

B)False

Q2) Binary trees can be divided into A) branches

B) leaves

C) subtrees

D) sawdust

E) None of these

Q3) When a binary tree is used to facilitate a search, it is referred to as a A) binary queue

B) binary ordered deque

C) sort algorithm

D) binary search tree

E) None of these

Q4) All nodes to the right of a node hold values greater than that node's value.

A)True

B)False

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

Turn static files into dynamic content formats.

Create a flipbook