CS 235 Quizlet

¡Supera tus tareas y exámenes ahora con Quizwiz!

What is the difference between const and the preprocessor directive #define?

#define is a macro definition and directs the preprocessor to replace every occurrence of the name with the sequence of characters before the program compiles #Define before code replaces each values with it Const is referenced repeatedly. (Used for our class)

Using an iterator named iter how would the () container data be accessed?

*iter & gets address * gets contents

What is a C++ concept?

A C++ concept serves as a constraint by limiting the set of arguments that are accepted as template parameters.

*What is TRUE of C++ strings?

A C++ string is an alias for a basic_string<char>

What is the relationship between a class and an object?

A class is a named description for a group of objects (objects are instances of the class). Class = six pack corona beer; Object = each delicious beer

*What is True of a class friend function?

A friend function is a non-member function with access to the class private and protected members.

What is a has-a, is-a, relationship?

A jet is a plane. A train has an engine.

What are C++ input/output manipulators?

A member function of the stream input/output classes that can be used to control the format of subsequent input or output. Set precision, set width

What is the difference between a pointer variable and a reference variable?

A pointer variable can be assigned a value at any time, while a reference variable cannot be re-assigned.A pointer variable is a variable that holds a memory address.A reference variable is an alias for an already existing variable.

What is the difference between a pointer variable and an array name?

A pointer variable points to a single location in memory, while an array name refers to all of the elements. Both need to be dereferenced, however: a[i ] is equivalent to *(a + i) for array or pointer a; A pointer you can change the address of; An array you can't change address of

What is a C++ stream?

A stream is an abstraction that represents a device on which input and ouput operations are performed. Sstream, fstream, etc.

What is TRUE of a translation unit?

All source files, together with their included header files, are called the translation unit. (Maybe comments)

*With try-catch blocks, the catch clauses ________.

Appear from most specific to most general

Why is a Node typically defined as a struct in the private part of the host class?

Because a struct's data members are public by default.

What is the difference between white box testing and black box testing?

Black-box testing tests the item (function, class, or program) based on its interfaces and functional requirements. White-box testing tests the software element (function, class, or program) using knowledge of its internal structure.

How to find Big O?

Chapter 2 powerpoint

What is C++ object delegation?

Delegation allow exposure to some functionality of a pre-existing class, but still control access through your own interface.

*For a program to execute correctly, __________.

Don't be stoopid

The "order of complexity" of an algorithm expresses ______.

Efficiency of a program

What is the result of the postfix expression: ()?

Expression is 4 7 * 20 -a. -136 b. -52 c. 8 d. There is none. It is an invalid expression.Answer is C

What is the matching postfix expression for the following infix expression: ()?

Expression is 7 + (2 * 3) / 9a. - ((8 + 9) * 4) b. ((8 + 9) * 4) c. - (8 + 9 * 4) d. There is none, it is an invalid expression.Answer is B

What is the matching infix expression for the following postfix expression: ()?

Expression is 8 9 + 4 * -a. - ((8 + 9) * 4) b. ((8 + 9) * 4) c. - (8 + 9 * 4) d. There is none, it is an invalid expression.Answer is D

*The Waterfall software development model ______.

It assumes that each stage can be completed correctly and fully before advancing to the next stage.

What is TRUE of every switch statement?

It is not required that each case be enclosed in braces. The expression used in a switch statement must have an integral enumerated type. (Has to take a character or int as input) When a break statement is reached, control jumps to the next line following the switch statement.

What is the principal advantage of a C++ class template?

Its ability to contain different types of data (determined at run time).

What are consequences of calling by reference?

Its an alias so you can't change the address

Which of the following accurately describes the behavior of a stack?

Last in, first out

Inserting at the back of a singly-linked list is ________.

Less efficient than inserting at the tail

When using an ofstream what happens when the output file name already exists?

List the operations performed by the C++ preprocessor.

*What type of errors probably exist in a significant portion of commercial software?

Logic

Which of the following is TRUE about multiple inheritance?

Multiple inheritance can often be avoided by refactoring.

What is the Big-O of a vector () function if its reserve function creates a new array that is () times the size of the current array?

O 1

To convert from infix to postfix, use a stack of __________.

Operators

Suppose you want to access the () element pushed on a stack. Which function would you use?

Original question asks for next element, in which case you would use top()

To check for balanced parentheses, use a stack of ________.

Parentheses

Which part of the compiler program merges the include files into the source file?

Preprocessor (the #include <iostream> then includes the iostream file)

What order is used is used in the C++ tool chain?

Preprocessor, compiler, assembler, linker.

We might choose a linked list over a vector because ________.

Removal from a linked list is more efficient. Inserting at the beginning of a linked list is more efficient.

*For which type of error are try and catch most appropriate?

Run time errors

*What is "regression testing"?

Testing to make sure a change did not have an unintended consequence.

Which of the following is NOT a software development model?

The Waterfall, Unified Software Life Cycle Models are all valid, probably anything that doesn't match those is not real.

*Which of the following operators CANNOT be overloaded?

The dot operator

*If an exception is thrown in a program and not caught _________.

The program aborts

How does the compiler generate the address of a variable named x?

The variable is created in the stack unless it is global

Which of the following is a FALSE statement about abstract classes?

This statement is true: An abstract class cannot be instantiated.

*Which of the following describes testing the smallest testable piece of the software?

Unit testing

The two general methods to implement a stack ADT are _______.

Using a contiguous structure or a linked structure

What are "use cases"?

a list of the user actions and system responses for a particular subproblem in the order that they are likely to occur.

Which of the following stack configurations are correct in terms of precedence?

a. + % b. * - c. + + d. / *Answer is A

The preprocessor conditional compilation directives _____________

are used to eliminate lines at compilation time. #ifdef, #ifndef, #else, and #endif Causes you to only include the necessary code from other files.

What is the proper relationship between class List and class Ordered_List?

class Ordered_List has-a List.

A private data member is visible _______.

in the class in which it is declared.

The main function parameters are _______________.

int argc, char* argv[]

*Software practitioners use the term "bugs," but _________.

it tends to trivialize potentially serious consequences of program defects.

All of the following statements are true of iterators EXCEPT what?

the iterator end() function returns a pointer to the last element on the container.

The default copy constructor may be used EXCEPT _________.

when a deep copy is required.


Conjuntos de estudio relacionados

Chapter 24: Baroque Art by tennislove (POPES, PEASANTS, MONARCHS, AND MERCHANTS)

View Set

Nclex Review: Tough practice questions archer review 2

View Set

HIT 1.2 #A (Match the following systems of the body with their functions)

View Set

GCP for Clinical Trials Involving Drugs and Devices

View Set

Holistic Genes and Development Part 3

View Set