Question
QUESTION 16 Coding the keyword static on a block scope variable A. Changes the variable's storage class from automatic to static. B. Changes the variable's
QUESTION 16
-
Coding the keyword static on a block scope variable
A. Changes the variable's storage class from automatic to static.
B. Changes the variable's storage class from static to automatic.
C. Shares the variable among all functions of the file.
D. Changes the variable's linkage, making it impossible to export the variable to a different source code file.
2 points
QUESTION 17
-
Coding the keyword static on a global variable
A. Changes its storage class from automatic to static.
B. Shares the variable among all functions of the file.
C. Changes the variable's storage class from static to automatic.
D. Changes the variable's linkage, making it impossible to export the variable to a different source code file.
2 points
QUESTION 18
-
Data members of a class should normally be made
A. preserved
B. public
C. protected
D. private
2 points
QUESTION 19
-
Given this variable declaration:
double average = 6.2;
If no output manipulators have been used up to this point in the program, which of the following statements will cause the value of the variable average to be printed as 6.20?
A. cout << showpos << setprecision(2) << average;
B. cout << scientific << setprecision(3) << average;
C. cout << fixed << setprecision(2) << average;
D. cout << showpoint << average;
2 points
QUESTION 20
-
What header file must be included to use the strcat() function?
A. B. C. D.
2 points
QUESTION 21
-
What types of C++ identifiers have class scope?
A. Local variables and arguments declared in a class member function.
B. Member functions of a class and data members of a class.
C. Global variables and standalone functions.
D. Member functions of a class, data members of a class, and local variables and arguments declared in a class member function.
2 points
QUESTION 22
-
What are the prerequisites in the following makefile rule?
store: main.o store.o $(CXX) $(CXXFLAGS) -o store main.o store.o
A. store
B. main.o store.o
C. $(CXXFLAGS)
D. $(CXX) $(CXXFLAGS) -o store main.o store.o
2 points
QUESTION 23
-
What header file must be included to use the C++ string class?
A. B. C. D. None. The class string is a built-in C++ data type.
2 points
QUESTION 24
-
What is the Unix command to do a detailed ("long") listing of files in the current directory, including information such as access permissions, file size, modification data and time, etc.?
A. list
B. dir
C. ls -a
D. ls -l
2 points
QUESTION 25
-
What is the Unix command to list all files in the current directory, including any hidden files whose names begin with a period?
A. ls -l
B. list
C. dir
D. ls -a
2 points
QUESTION 26
-
What is the target in the following makefile rule?
store: main.o store.o $(CXX) $(CXXFLAGS) -o store main.o store.o
A. $(CXXFLAGS)
B. store
C. $(CXX) $(CXXFLAGS) -o store main.o store.o
D. main.o store.o
2 points
QUESTION 27
-
Which of the following I/O manipulators does not have a persistent effect and must be coded for each value printed?
A. fixed
B. left
C. setw
D. setprecision
2 points
QUESTION 28
-
Which of the following I/O manipulators requires that the header file
be included? A. endl
B. setprecision(4)
C. fixed
D. showpos
2 points
QUESTION 29
-
Which of the following function prototypes using default argument values is illegal in C++?
A. void add(int, int);
B. void add(int = 0, int = 0);
C. void add(int = 0, int);
D. void add(int, int = 0);
2 points
QUESTION 30
-
Recursion may be replaced with
A. Nothing can take the place of recursion, it's just that awesome.
B. a queue structure.
C. looping.
D. looping or a looping and a stack. structure (to take the place of the program stack).
2 points
QUESTION 31
-
In what part of a C++ program's memory are global or file scope variables stored?
A. The stack
B. The static data region
C. The heap
D. The free store
2 points
QUESTION 32
-
Which g++ option is used to specify the name of the executable file that will be created if the source file(s) are successfully compiled and linked?
A. -o
B. -c
C. -Wall
D. -std=c++11
2 points
QUESTION 33
-
Which of the following algorithm complexities has the fastest rate of increase (i.e., represents the least efficient algorithm)?
A. O(N2)
B. O(log2 N)
C. O(2N)
D. O(N)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started