CS 210 chapter 17

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

* is the dereference operator that allows the program to access the value pointed to by the pointer.

True

A linked list is a list wherein each item contains not just data but also a pointer—a link—to the next item in the list.

True

The % (modulo operator) computes the integer remainder when dividing two numbers.

True

a class data member variables are known as data members?

True

UML uses italics to denote _____ classes.

abstract

Which syntax is used to create a template object of data type myData for a class className ?

className<myData> classObject;

the variables within the struct definition are called:

data members

an orgnizer of a 64-person meeting wants to

false

if a compiler generates a specific message like "missing semicolon", then a semicolon must be missing somewhere, though maybe from an earlier line

false

if a const accessor function call a non-const member function, a data member might get changed?

false

we use accessors for setting data?

false

Which is the correct syntax for the class's functions defined outside the class declaration?

larger<varType>:: largeFunc();

Which statement generates an error? Why?

leagueName = newPlayers.GetLeague(); will generate an error as GetLeague is not a member of Players class.

which statement displays the address of the variable num1?

none

public, protected, private

public : "public-->public, protected-->protected" -- public members of BaseClass are accessible as public members of DerivedClass, and protected members of BaseClass are accessible as protected members of DerivedClass. protected : "public-->protected, protected-->protected" -- public and protected members of BaseClass are accessible as protected members of DerivedClass. private : "public-->private, protected-->private" -- public and protected members of BaseClass are accessible as private members of DerivedClass. Incidentally, if the specifier is omitted as in "class DerivedClass: BaseClass {...}", the default is private.

an___ is often defined for a record of information

struct

A function template is a function definition having a special type parameter that may be used in a place of types in the function

true

A function template may have multiple variable

true

A list is an abstract data type

true

In big O notation constants in product terms are omitted. For O(3*N), The constant 3 is omited yeildin O(N)

true

a preprocessor directive does not require a semicolon at the end?

true

c++ does not have a built in data type for sorting of characters?

true

creating a recursive function can be accomplished in 2 steps: write the base case write the recursive case

true

escape sequences are always stored internally as a single character?

true

if a program is written in a messy and inefficient style, it will definitely have compiler errors

true

recursion occurs when a function's statement include a call to the function itself.

true

Which keyword can be used instead of class? template <class T> T someFunction(T arg) { ... .. ... }

typename

a modulo has function is used to map to indices 0 to 9 the has function should be key%------

10

int mystery ( int number ) { if ( number <= 1 ) return 1; else return number * mystery( number - 1 ); }

24

override foo in from base class Base

Base::foo()

Which of the following relationships depicts an is-a relationship?

Building - School

A hash table stores ordered items.

False

If two class have a has a relationship, we should use polymorphism?

False

The simplified Big O of the following 3*N*O(N^2) is O(N^2)

False

The simplified big o of the following 2*N^3+O(N^2) is O(N^2+N^3)?

False

Identify the base case for the Fibonacci series.

Line 1

which one of the following big o notations is equivalent to O(3*N+N)?

O(N)

which one of the following big o notations is equivalent to O(N+4)?

O(N)

Overriding vs. overloading

Overriding differs from overloading. In overloading, functions with the same name must have different parameter types. In overriding, a derived class member function takes precedence over a base class member function with the same name, regardless of the parameter types. Overloading is not performed if derived and base member functions have different parameter types; the member function of the derived class hides the member function of the base class.

Fill in the blank: template<typename _____> class GameScore { public: GameScore(Score val1 = 0, Score val2 = 0, Score val3 = 0); ... ...}

Score

What does a compiler do when a function template small is called in the main function of a program?

The compiler automatically generates a unique function definition for each data type appearing in function calls to the function template.


Conjuntos de estudio relacionados

Perry: Chapter 4: Reproduction Systems Concerns EAQ

View Set

Comparing fractions, Decimals, and Percents

View Set

Software, File and Platform Services

View Set

Chapter 11 - Managing Project Risks

View Set

OS Worksheet International Trade (Micro)

View Set

BI100 Practice Quizzes (Ch. 10-13)

View Set