Programming Methodology Exam Review - 891 Verified Questions

Page 1


Programming Methodology Exam Review

Course Introduction

Programming Methodology introduces students to the fundamental principles of computer programming and problem-solving using a high-level programming language. The course emphasizes algorithmic thinking, software design, decomposition, abstraction, and debugging techniques. Students learn to write clear, efficient, and well-documented code while exploring key concepts such as control structures, data types, functions, and modular programming. Through lectures, hands-on assignments, and collaborative projects, students build a strong foundation essential for advanced studies in computer science and effective software development.

Recommended Textbook

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

Available Study Resources on Quizplus

20 Chapters

891 Verified Questions

891 Flashcards

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

Page 2

Chapter 1: Introduction to Computers and Programming

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

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

Sample Questions

Q1) The computer's main memory is commonly known as:

A)The hard disk

B)The floppy disk

C)RAM

D)Secondary storage

E)None of the above

Answer: C

Q2) Characters or symbols that perform operations on one or more operands are:

A)Syntax

B)Op codes

C)Operators

D)Program ops

E)None of the above

Answer: C

Q3) A CPU really only understands instructions that are written in 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: Introduction to C Plus Plus

Available Study Resources on Quizplus for this Chatper

60 Verified Questions

60 Flashcards

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

Sample Questions

Q1) Assume that a program has the following string object definition: string name; Which of the following statements correctly assigns a string literal to the string object?

A)name = Jane;

B)name = "Jane";

C)name = 'Jane';

D)name = (Jane);

Answer: B

Q2) Every complete C++ program must have a ________.

A)comment

B)function named main

C)preprocessor directive

D)symbolic constant

E)cout statement

Answer: B

Q3) A preprocessor directive does not require a semicolon at the end.

A)True

B)False

Answer: True

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

44 Verified Questions

44 Flashcards

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

Sample Questions

Q1) The only difference between the get function and the >> operator is that get reads the first character typed, even if it is a space, tab, or the [Enter] key.

A)True

B)False

Answer: True

Q2) When this operator is used with string operands it concatenates them, or joins them together.

A)&

B)*

C)%

D)+

E)None of the above

Answer: D

Q3) When the fixed manipulator is used, the value specified by the setprecision manipulator will be the number of digits to appear after the decimal point.

A)True

B)False

Answer: True

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

53 Verified Questions

53 Flashcards

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

Sample Questions

Q1) The ________ of a variable is limited to the block in which it is declared.

A)precedence

B)associativity

C)scope

D)branching ability

E)None of these

Q2) When a relational expression is false, it has the value ________.

A)one

B)zero

C)zero, one, or minus one

D)less than zero

E)None of these

Q3) Both of the following if statements perform the same operation. if (sales > 10000)

commissionRate = 0.15; if (sales > 10000)commissionRate = 0.15;

A)True

B)False

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

Chapter 5: Loops and Files

Available Study Resources on Quizplus for this Chatper

63 Verified Questions

63 Flashcards

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

Sample Questions

Q1) The update expression of a for loop can contain more than one statement, e.g. counter++, total+= sales.

A)True

B)False

Q2) This is a special value that marks the end of a list of values.

A)constant

B)variable

C)loop

D)sentinel

E)None of these

Q3) This statement may be used to stop a loop's current iteration and begin the next one.

A)break

B)terminate

C)re-iterate

D)continue

E)None of these

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

Sample Questions

Q1) In a function header, you must furnish:

A)data type(s)of the parameters

B)data type of the return value

C)the name of function

D)names of parameter variables

E)All of these

Q2) It is a good programming practice to ________ your functions by writing comments that describe what they do.

A)execute

B)document

C)eliminate

D)prototype

E)None of these

Q3) This type of variable is defined inside a function and is not accessible outside the function.

A)global

B)reference

C)local

D)counter

E)None of these

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

Chapter 7: Arrays

Available Study Resources on Quizplus for this Chatper

58 Verified Questions

58 Flashcards

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

Sample Questions

Q1) In C++ 11, the range-based for loop is best used in situations where you need the element subscript for some purpose.

A)True

B)False

Q2) If an array is partially initialized, the uninitialized elements will be set to zero.

A)True

B)False

Q3) An array with no elements is ________.

A)legal in C++

B)illegal in C++

C)automatically furnished one element, with a value of zero

D)automatically furnished one value-the null terminator

E)None of these

Q4) A two-dimensional array is like ________ put together.

A)an array and a function

B)several identical arrays

C)two functions

D)two arrays of different types

E)None of these

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

20 Verified Questions

20 Flashcards

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

Sample Questions

Q1) A linear search can only be implemented with integer values.

A)True

B)False

Q2) Regardless of the algorithm being used, a search through an array is always performed ________.

A)from lowest to highest element

B)from highest to lowest element

C)beginning with the middle element

D)using a binary search

E)None of these

Q3) A(n)________ search uses a loop to sequentially step through an array.

A)binary

B)unary

C)linear

D)relative

E)None of these

Q4) The number of comparisons made by a binary search is expressed in powers of two.

A)True

B)False

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

Chapter 9: Pointers

Available Study Resources on Quizplus for this Chatper

45 Verified Questions

45 Flashcards

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

Sample Questions

Q1) To use any of the smart pointers in C++ 11, you must #include the memory header file with the following directive:

#include <memory>

A)True

B)False

Q2) To help prevent memory leaks from occurring in C++ 11, a ________ automatically deletes a chunk of dynamically allocated memory when the memory is no longer being used.

A)null pointer

B)smart pointer

C)dereferenced pointer

D)A and C only

E)None of these

Q3) When you pass a pointer as an argument to a function, you must ________.

A)declare the pointer variable again in the function call

B)dereference the pointer variable in the function prototype

C)use the #include<func_ptr.h> statement

D)not dereference the pointer in the function's body

E)None of these

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

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

Available Study Resources on Quizplus for this Chatper

45 Verified Questions

45 Flashcards

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

Sample Questions

Q1) In C++, 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 these

Q2) To determine whether a character is whitespace, use this function.

A)iswhite

B)isspace

C)iswhitespace

D)isblank

E)None of these

Q3) Which statement converts the string "10" to the integer value 10?

A)itoa("ten")

B)atoi("ten")

C)atoi("10")

D)itoa(10)

E)None of these

Page 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

53 Verified Questions

53 Flashcards

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

Sample Questions

Q1) 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)All of these

E)None of these

Q2) Which of the following assigns a value to the hourlyWage member of employee[2]?

A)employee[2]->hourlyWage = 50.00;

B)employee2.hourlyWage = 7.50;

C)hourlyWage[2].employee = 29.75

D)employee[2].hourlyWage = 100.00;

E)None of these

Q3) If an anonymous union is declared globally (outside all functions), it must be ________.

A)empty

B)declared static

C)explicitly declared "global"

D)initialized and used outside any function

E)None of these

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

Sample Questions

Q1) Which statement opens a file in such a way that information will only be written to its end?

A)dataFile(open.append("info.dat"));

B)dataFile.open("info.dat", ios::out | ios::app);

C)dataFile.open = "C:\\info.dat" ios:append;

D)open(dataFile.append);

E)None of these

Q2) This member function writes a single character to a file. A)get

B)write

C)put

D)insert

E)None of these

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

A)True

B)False

Q4) To write to a file, you use the file_write()function.

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

47 Verified Questions

47 Flashcards

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

Sample Questions

Q1) A class is a(n)________ that is defined by the programmer.

A)data type

B)function

C)method

D)attribute

E)None of these

Q2) Examples of access specifiers are the key words:

A)near and far

B)opened and closed

C)private and public

D)table and row

E)None of these

Q3) If a local variable and a global variable have the same name within the same program, the ________ resolution operator must be used.

A)variable

B)ambiguity

C)scope

D)global

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

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) This type of member variable may be accessed before any objects of the class have been created.

A)private

B)public

C)inline

D)static

E)None of these

Q2) When a class declares an entire class as its friend, the friendship status is reciprocal. That is, each class's member functions have free access to the other's private members.

A)True

B)False

Q3) When you overload an operator, you can change the operator's original meaning to something entirely different.

A)True

B)False

Q4) A non-static member function may not access a static member variable.

A)True

B)False

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

Page 16

Chapter 15: Inheritance, Polymorphism, and Virtual Functions

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

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

Sample Questions

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

Q2) ________ members of a base class are never accessible to a derived class.

A)Public

B)Private

C)Protected

D)A, B, and C

E)None of these

Q3) More than one class may be derived from a base class.

A)True

B)False

Q4) In C++ 11, if a derived class attempts to override a final member function, the compiler generates an error.

A)True

B)False

Q5) A derived class may become a base class, if another class is derived from it.

A)True

B)False

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

39 Verified Questions

39 Flashcards

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

Sample Questions

Q1) The beginning of a function template is marked by a ________.

A)return type

B)parameter list

C)template prefix

D)semicolon

E)None of these

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

Q3) If an exception is thrown by a member function of a class object, then the class ________ is called.

A)constructor

B)destructor

C)catcher

D)handler

E)None of these

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

40 Verified Questions

40 Flashcards

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

Sample Questions

Q1) The advantage a linked list has over a vector is:

A)A linked list can dynamically shrink or grow, and a vector cannot

B)A linked list is smaller than a vector

C)A node can be inserted into or removed from a linked list faster than from a vector

D)Data removal and insertion are more accurate with a linked list than with a vector

E)None of these

Q2) ADT stands for:

A)Algorithm Dependent Template

B)Algorithm Driven Template

C)Abstract Data Type

D)Automatic Data Type

E)None of these

Q3) In a circular-linked list, the last node points to the ________.

A)head pointer

B)tail pointer

C)first node

D)closing curly brace of the original structure declaration

E)None of these

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

19

Chapter 18: Stacks and Queues

Available Study Resources on Quizplus for this Chatper

47 Verified Questions

47 Flashcards

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

Sample Questions

Q1) A ________ stack or queue is built around the linked-list.

A)dynamic

B)static

C)deque-based

D)floating point

E)None of these

Q2) This is a double-ended queue.

A)two-headed stack

B)two-tailed vector

C)circular array

D)deque

E)None of these

Q3) Push and pop are the two most common queue operations.

A)True

B)False

Q4) Endeque and deque are the two most common queue operations.

A)True

B)False

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

Page 20

Chapter 19: Recursion

Available Study Resources on Quizplus for this Chatper

22 Verified Questions

22 Flashcards

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

Sample Questions

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

Q2) The programmer must ensure that a recursive function does not become:

A)a static function

B)a virtual function

C)an endless loop

D)a dynamic function

E)None of these

Q3) Any algorithm that can be coded with recursion can also be coded with an iterative structure.

A)True

B)False

Q4) Like a loop, a recursive function must have some method 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 21

Chapter 20: Binary Trees

Available Study Resources on Quizplus for this Chatper

38 Verified Questions

38 Flashcards

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

Sample Questions

Q1) A good reason to use the binary tree structure is:

A)to expedite the process of searching large sets of information

B)aesthetics and program design

C)code readability

D)it is more flexible than the Unary Tree structure

E)None of these

Q2) When a binary tree is used to facilitate a search, it is referred to as a ________.

A)binary queue

B)binary ordered deque

C)binary search tree

D)sort algorithm

E)None of these

Q3) The ________ in a binary tree is similar to the head pointer in a linked list.

A)root pointer

B)leaf pointer

C)null pointer

D)binary pointer

E)None of these

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

22

Turn static files into dynamic content formats.

Create a flipbook