Skip to main content

Introduction to Programming Exam Review - 766 Verified Questions

Page 1


Introduction to Programming Exam Review

Course Introduction

Introduction to Programming provides students with a foundational understanding of computer programming concepts and problem-solving techniques. The course covers essential topics such as algorithms, control structures, data types, variables, input/output operations, and debugging. Through hands-on exercises and projects, students learn to write, test, and debug basic programs using a programming language like Python or Java. Emphasis is placed on logical thinking, code readability, and good programming practices, preparing students for further study in computer science and software development.

Recommended Textbook

Starting out with C++ Early Objects 9th Edition by Tony Gaddis

Available Study Resources on Quizplus

19 Chapters

766 Verified Questions

766 Flashcards

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

Chapter 1: Introduction to Computers and Programming

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) List five elements that are common to all programming languages.

Answer: keywords, programmer-defined symbols, operators, punctuation, and syntax

Q2) ________ is an example of volatile memory, used for temporary storage while a program is running.

A) A flash drive

B) The ALU

C) RAM

D) The CPU

E) A hard disk

Answer: C

Q3) The statements written by a programmer are called A) syntax.

B) object code.

C) source code.

D) language elements.

E) none of the above.

Answer: C

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

Chapter 2: Introduction to C Plus Plus

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) Every C++ program must have A) comments.

B) variables.

C) literals.

D) a function called main..

E) all of the above.

Answer: D

Q2) In a C++ program, two slash marks ( // ) indicate the beginning of A) a block of code.

B) a comment.

C) a variable definition.

D) a program.

E) none of the above.

Answer: B

Q3) The following statements both declare the variable num to be an integer. int num; INT num;

A)True

B)False

Answer: False

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

Chapter 3: Expressions and Interactivity

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) The statement cout << setw(4) << num4 << " ";

A) outputs the value of num4 rounded to 4 decimal places.

B) outputs "setw(4)" before the value in the variable num4.

C) outputs the first 4 digits of the number stored in num4.

D) outputs the value stored in num4 four times.

E) does none of above.

Answer: E

Q2) In C++, a value can be raised to a power by using A) the ^ operator.

B) the exp operator.

C) the power operator.

D) the pow function.

E) the square function.

Answer: D

Q3) When a C++ expression is evaluated, binary operations are performed before unary operations.

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

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) The expression x < y is called a(n) ________ expression.

A) arithmetic

B) logical

C) relational

D) comparison

E) binary

Q2) When a program lets the user know that an invalid menu choice has been made, this is an example of

A) input validation.

B) output validation.

C) menu reselection.

D) invalidation.

E) being user unfriendly.

Q3) Relational expressions and logical expressions are both Boolean, which means they evaluate to True or false.

A)True

B)False

Q4) All of the relational operators are binary.

A)True

B)False

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

Chapter 5: Looping

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) If a while loop has no braces around the body of the loop

A) there is no loop body.

B) the loop body ends when the endwhile statement is encountered.

C) the loop body contains just one statement.

D) the program will not compile.

E) the program will compile, but not run.

Q2) ________ are C++ operators that change their operands by one.

A) + and -

B) ++ and --

C) binary and unary

D) arithmetic and relational

E) conditional and relational

Q3) A sentinel is a special value that

A) is used for data validation.

B) must be Boolean.

C) marks the end of a list of values.

D) must be a negative number.

E) is all of the above.

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

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) An overloaded function is one

A) that calls other functions.

B) that has the same name as another function.

C) that has too many parameters.

D) that attempts to do too much in a single function.

E) that does different things depending on who calls it.

Q2) The value in ________ local variable is retained between function calls.

A) a global

B) an internal

C) a static

D) a dynamic

E) no

Q3) A function ________ includes the statements that make up the function. A) definition

B) prototype

C) call

D) heading

E) parameter

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

8

Chapter 7: Introduction to Classes and Objects

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) A constructor that does not require that any arguments be passed to it is called a(n) ________ constructor.

A) empty

B) default

C) stand-alone

D) zero-element

E) useless

Q2) A constructor must have the same name as the

A) first private data member.

B) first public data member.

C) class.

D) first object of the class.

E) function return type.

Q3) A constructor is a public class function that gets called whenever you want to re-initialize an object's member data.

A)True

B)False

Q4) A class must have exactly one constructor.

A)True

B)False

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

Chapter 8: Arrays

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) After carrying out the following two statements, sales will have been created as a one-dimensional array that can hold 20 double values. typedef salesArray double[20]; salesArray sales;

A)True

B)False

Q2) Which of the following statements correctly initialize the value variable?

A) int value = 8;

B) int value{8};

C) int value(8);

D) All of the above.

E) Both A and B, but not C.

Q3) In C++ If you attempt to store more data in an array than it can hold, the compiler will issue an error.

A)True

B)False

Q4) An array can be returned by a function as well as passed to a function.

A)True

B)False

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

Chapter 9: Searching, Sorting, Algorithm Analysis

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) To find a value that is in an unordered array of 100 items, how many values must linear search examine on average?

A) 7

B) 10

C) 50

D) 100

E) 101

Q2) A sorting algorithm can be used to arrange a set of ________ in ________ order. A) numeric values, ascending B) numeric values, descending C) strings, ascending D) strings, descending E) All of the above.

Q3) When searching for a particular object in an array of objects, it is necessary to compare the search key to the value in each examined object's key field.

A)True B)False

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

11

Chapter 10: Pointers

Available Study Resources on Quizplus for this Chatper

62 Verified Questions

62 Flashcards

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

Sample Questions

Q1) The statement int *ptr; means

A) the variable called ptr will store an integer value.

B) the variable called *ptr will store an asterisk and an integer value.

C) ptr is a pointer variable that will store the address of an integer variable.

D) All of the above

E) None of the above

Q2) To dereference a structure pointer and simultaneously access a member of the structure, the appropriate operator to use is

A) the ampersand, &.

B) an asterisk, *.

C) the structure pointer operator, ->.

D) the dereference operator, <-.

E) None of the above

Q3) A dangling pointer is a pointer

A) to a block of memory that has been deleted.

B) that has been declared, but has not yet been assigned a value.

C) that has not been initialized.

D) that has been assigned the value of null or null_ptr.

E) None of the above

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

Page 12

Chapter 11: More About Classes and Object-Oriented Programming

Available Study Resources on Quizplus for this Chatper

70 Verified Questions

70 Flashcards

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

Sample Questions

Q1) When you overload the << operator, you must also overload the >> operator.

A)True

B)False

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

Q3) If a member variable is declared ________, all objects of that class share access to that variable.

A) static

B) dynamic

C) inline

D) default

E) None of the above

Q4) A base class cannot contain a pointer to one of its derived classes.

A)True

B)False

Q5) A static member function cannot be called if no objects of the class exist. A)True

B)False

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

Chapter 12: More on C-Strings and the String Class

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) A C-string is a sequence of characters stored in consecutive memory, terminated by a

A) period.

B) space.

C) null character.

D) semicolon.

E) None of the above

Q2) The ________ function concatenates the contents of one C-string with another C-string.

A) strcopy

B) strappend

C) strcat

D) stradd

E) None of the above

Q3) The C++ compiler performs strict array bounds checking whenever an array of characters is being accessed.

A)True

B)False

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

14

Chapter 13: Advanced File and Io Operations

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) The ________ data type can be used to create files and write information to them.

A) ofstream

B) ifstream

C) istream

D) ostream

E) None of the above

Q2) When used by itself, ________ causes a file's contents to be deleted if the file already exists.

A) ios:app

B) ios::in

C) ios::out

D) All of the above

E) None of the above

Q3) File output may be formatted the same way as screen output.

A)True

B)False

Q4) When you store data in a variable, it is automatically saved in a file.

A)True

B)False

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

Chapter 14: Recursion

Available Study Resources on Quizplus for this Chatper

20 Verified Questions

20 Flashcards

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

Sample Questions

Q1) The quicksort algorithm works on the basis of A) three sublists.

B) two sublists and a pivot.

C) two pivots and a sublist.

D) three pivots.

E) None of the above

Q2) Suppose that a recursive function with integer parameter n has a base case of 0, and for each non-base case, the function makes a recursive call with argument n+1. If the function is initially called with an actual argument of n = 3, the function call will

A) cause an infinite chain of recursive calls.

B) return after a chain of 2 recursive calls.

C) return after a chain of 3 recursive calls.

D) return after a chain of 4 recursive calls.

E) None of the above

Q3) Any algorithm that can be coded with recursion can also be coded using a loop.

A)True

B)False

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

Chapter 15: Polymorphism and Virtual Functions

Available Study Resources on Quizplus for this Chatper

22 Verified Questions

22 Flashcards

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

Sample Questions

Q1) A virtual member function of class that should not be overridden in a derived class should be declared

A) with the keyword const.

B) with the keyword final.

C) with symbol ! followed by the keyword override.

D) as private in its class.

E) as protected in its class.

Q2) Declaring a member function of a class to be a ________ will cause the C++ compiler to use dynamic binding.

A) constructor function

B) destructor function

C) static function

D) virtual function

E) None of the above

Q3) ________ functions are dynamically bound by the compiler.

A) Constructor

B) Destructor

C) Static

D) Virtual

E) None of the above

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

Chapter 16: Exceptions, Templates, and the Standard

Template Library Stl

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) In a function template, the programmer substitutes ________ for ________.

A) parameters, data types

B) parameters, arguments

C) arguments, parameters

D) angle brackets, parentheses

E) None of the above

Q2) The Standard Template Library (STL) contains templates for useful algorithms and data structures.

A)True

B)False

Q3) ________ are used to signal errors or unexpected events that occur while a program is running.

A) Virtual functions

B) Destructors

C) Exceptions

D) Templates

E) None of the above

Q4) Non-template functions have a slight advantage in speed over template functions.

A)True

B)False

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

Chapter 17: Linked Lists

Available Study Resources on Quizplus for this Chatper

38 Verified Questions

38 Flashcards

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

Sample Questions

Q1) A new node cannot become the first node in the list.

A)True

B)False

Q2) Each node in a ________ list contains pointers to the nodes before and after it.

A) singly-linked

B) doubly-linked

C) circular-linked

D) both B and C

E) None of the above

Q3) To concatenate two linked lists, it is necessary to

A) traverse one of the lists to get to its end.

B) traverse both lists to get to their ends.

C) first reverse one of the lists.

D) first reverse both lists.

E) None of the above

Q4) Deleting an entire linked list requires a call to the delete operator for each node in the list.

A)True

B)False

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

Chapter 18: Stacks and Queues

Available Study Resources on Quizplus for this Chatper

36 Verified Questions

36 Flashcards

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

Sample Questions

Q1) For most people, ________ queues are more intuitive and easier to understand than ________ queues.

A) Static, dynamic

B) Dynamic, static

C) Deque-like, stack-like

D) Stack-like, deque-like

E) None of the above

Q2) Two primary queue operations are

A) push and pop.

B) enqueue and dequeue.

C) insert and delete.

D) onqueue and offqueue.

E) None of the above

Q3) A dynamic stack has a ________ size, and is implemented as a(n) ________.

A) variable, linked list

B) fixed, linked list

C) variable, array

D) fixed, array

E) None of the above

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

Page 20

Chapter 19: Binary Trees

Available Study Resources on Quizplus for this Chatper

38 Verified Questions

38 Flashcards

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

Sample Questions

Q1) In a binary search tree, all nodes to the right of a node hold values greater than the node's value.

A)True

B)False

Q2) A child node that has no parent is

A) a leaf node.

B) an orphan node.

C) a rootless node.

D) A or C

E) None of the above

Q3) There exists a binary tree with a hundred nodes, but only one leaf.

A)True

B)False

Q4) Output will be the same if you use inorder, postorder, or preorder traversals to print the values stored in a binary tree.

A)True

B)False

Q5) The height of a binary tree describes how many levels there are in the tree.

A)True

B)False

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

Turn static files into dynamic content formats.

Create a flipbook
Introduction to Programming Exam Review - 766 Verified Questions by Quizplus - Issuu