Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. In contrast to pointers, a reference in C++: a. must be initialized b. cannot have its value displayed c. is automatically dereferenced when used

1.

In contrast to pointers, a reference in C++:

a. must be initialized

b. cannot have its value displayed

c. is automatically dereferenced when used

d. none of the above

e. all of the above

2.

After executing the code fragment below, what is the result?

int var;

int& vr = var;

var = 3;

cout << vr;

a. a runtime error occurs because vr is not initialized

b. the value 0 is printed

c. the value 3 is printed

d. a runtime error occurs because vr has not been accessed

e. this code fragment will not compile

3.

The difference between accessing an entry in an array and accessing an entry in a

vector is

a. there is no difference

b. an entry is checked to see if it is in the vector before adding it

c. adding an item to the vector takes extra time but with an array memory is

automatically expanded to grow the array

d. finding an element in a vector is faster

e. none of the above

4.

The result of lexical analysis is

a. a classification of the input into tokens

b. recognizing if the input is valid in the target programming language

c. converting from Unicode to ASCII

d. None of the above

e. All of the above

5.

A regular expression matcher

a. Cannot count things

b. Uses direct matching and metacharacter matching

c. Must be deterministic

d. B and C only

e. A B and C

6.

A BNF grammar can best enforce operator precedence with

a. A precedence table

b. Hardcoding the precedence in the parser

c. The order of the operations in the grammar rules

d. Rewriting the parse tree

e. None: operator precedence must be enforced after parsing

7.

A language cannot be parsed with a recursive descent parser if it has:

a. More than 20 rules

b. Rules in the same form as a right regular grammar

c. Left recursion

d. Operators with the same precedence

e. A tabular representation of the grammar rules

8.

A static variable declared inside of a class means:

a. There is only one instance of that variable shared by all instances of the class

b. There is only one instance of that variable shareable by all classes

c. The superclass can change the static variable

d. The static variable is invisible to all functions outside of the class

e. The memory for the static variable will be on the heap

9.

Overloading a function means:

a. Several functions with different names return the same type

b. Several functions with the same name return different types

c. Several functions with the same name return the same type

d. All of the functions must be called to perform an operation

e. None of the above

10.

A destructor is called:

a. By the programmer to clean up the instance of the class

b. When delete is invoked

c. When an instance of an object is copied

d. Any time a static method needs to access an instance variable

e. None of the above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions