Accounting
Anthropology
Archaeology
Art History
Banking
Biology & Life Science
Business
Business Communication
Business Development
Business Ethics
Business Law
Chemistry
Communication
Computer Science
Counseling
Criminal Law
Curriculum & Instruction
Design
Earth Science
Economic
Education
Engineering
Finance
History & Theory
Humanities
Human Resource
International Business
Investments & Securities
Journalism
Law
Management
Marketing
Medicine
Medicine & Health Science
Nursing
Philosophy
Physic
Psychology
Real Estate
Science
Social Science
Sociology
Special Education
Speech
Visual Arts
Computer Science
Q:
Which of the following statements about UML class diagrams is false?
a. Like operations, the UML models constructors in the third compartment of a class diagram.
b. To distinguish a constructor from the class's operations, the UML requires that the word "constructor" be enclosed in guillemets and placed before the constructor's name.
c. It's customary to list constructors before other operations in the third compartment.
d. All of the above are true.
Q:
The compiler will implicitly create a default constructor if:
a. The class does not contain any data members.
b. The programmer specifically requests that the compiler do so.
c. The class does not define any constructors.
d. The class already defines a default constructor.
Q:
A default constructor has how many parameters?
a. 0.
b. 1.
c. 2.
d. Variable number.
Q:
Which of the following statements is false?
a. The default constructor does not initialize the class's fundamental-type data members, but does call the default constructor for each data member that's an object of another class.
b. A string's default constructor initializes the object to the empty string.
c. An uninitialized fundamental-type variable is implicitly initialized to zero.
d. If a class defines a constructor, the compiler will not create a default constructor for that class.
Q:
Which of the following statements is false?
a. A constructor that specifies a single parameter should be declared implicit.
b. A constructor does not specify a return type, because constructors cannot return values.
c. Constructors cannot be declared const (because initializing an object modifies it).
d. None of the above statements is false.
Q:
Normally, constructors are ________.
a. private
b. protected
c. privy
d. public
Q:
Which of the following statements is false?
a. Each class can define a constructor for custom object initialization.
b. A constructor is a special member function that must have the same name as the class.
c. C++ requires a constructor call for every object that's created.
d. A constructor cannot specify parameters.
Q:
d. The UML models operations by listing the operation name preceded by an access modifier. A(n) ________ indicates a public operation in the UML.
a. -
b. +
c. p
d. *
Q:
Which statement about UML class diagrams is true?
a. UML class diagrams can be used to summarize a class's attributes and operations.
b. In the UML, each class is modeled in a class diagram as a rectangle with three compartments.
c. The top compartment contains the class name centered horizontally in boldface type and the middle compartment contains the class's attribute names, which correspond to the data members of a class.
d. All of the above are true.
Q:
Which of the following statements is false?
a. Variables or functions listed after the public access specifier (and before the next access specifier, if there is one) are "available to the public." They can be used by other functions in the program, and by member functions of other classes.
b. By default, everything in a class is private, unless you specify otherwise.
c. You must list an access specifier for every member.
d. Declaring data members private is known as data hiding. private data members are encapsulated (hidden) in an object and can be accessed only by member functions of the object's class.
Q:
Which of the following statements is false?
a. The keyword private is an access specifier.
b. Access specifiers are always followed by a semicolon (;).
c. A private data member is accessible only to its class's member functions.
d. Most data-member declarations appear after the private access specifier.
Q:
A member function that does not, and should not, modify the object on which it's called is declared with ________ to the right of its parameter list.
a. final
b. const
c. firm
d. immutable
Q:
The ________ statement passes a value back to a function's caller.
a. recover
b. restore
c. pass
d. return
Q:
Which of the following statements is false?
a. Variables declared in a particular function's body are local variables, which can be used only in that function.
b. When a function terminates, the values of its local variables are preserved.
c. A function's parameters also are local variables of that function.
d. The argument types in the member function call must be consistent with the types of the corresponding parameters in the member function's definition.
Q:
Which of the following statements is false?
a. The number and order of arguments in a function call must match the number and order of parameters in the function definition's parameter list.
b. Every function body is delimited by an opening left brace and a closing right brace. Within the braces are one or more statements that perform the function's task(s).
c. When program execution reaches a function's closing brace, the function returns to its caller.
d. None of the above is false.
Q:
The return type ________ indicates that when a function completes its task, it does not return (i.e., give back) any information to its calling function.
a. null
b. virtual
c. nullptr
d. void
Q:
The default value for a string is ________.
a. null
b. void
c. blanks
d. the empty string
Q:
Which of the following statements is false?
a. Each object of a class shares one copy of the class's data members.
b. An object's data members exist before a program calls member functions on an object, while they are executing and after the member functions complete execution.
c. Data members are declared inside a class definition but outside its member functions' bodies.
d. Headers should never contain using directives or using declarations.
Q:
Which of the following statements is false?a. Class names, member function names and data member names are all identifiers.b. By convention, variable-name identifiers begin with an uppercase letter, and every word in the name after the first word begins with a capital letter; this naming convention is known as camel case.c. Also by convention, class names begin with an initial uppercase letter, and member function and data member names begin with an initial lowercase letter.d. All of the above are true.
Q:
Which of the following statements is true?
a. A class's body is enclosed in an opening left brace and a closing right brace.
b. A class definition terminates with a required semicolon.
c. Typically, each class definition is placed in a separate header with the .h filename extension.
d. All of the above are ture.
Q:
A member-function call can supply ________ that help the function perform its task.
a. parameters
b. arguments
c. classes
d. frameworks
Q:
Assuming that text is a variable of type string, what will be the contents of text after the statement cin >> text; is executed if the user types Hello World! then presses Enter?
a. "H"
b. "Hello"
c. "Hello World"
d. "Hello World!"
Q:
Q:
Functions that are not members of a class are called ________ functions.
a. isolated
b. global
c. universal
d. general
Q:
To call a member function for a specific object, you specify the object's name, followed by a(n) ________, then the member function name and a set of parentheses.
a. dot operator
b. colon
c. ::
d. ->
Q:
Files ending in .cpp are known as ________ files.
a. executable
b. secure C++
c. source-code
d. class
Q:
A header file is typically given the filename extension:
a. .h
b. .hdr
c. .header
d. .cpp
Q:
Which of the following statements is true?
a. The compiler knows about fundamental types that are "built into" C++.
b. A new type that you create is known as a user-defined type.
c. New classes, when packaged properly, can be reused by other programmers.
d. All of the above are true.
Q:
Typically, you cannot call a member function of a class until you create a(n) ________ of that class.
a. object
b. image
c. header
d. constructor
Q:
A main function can "drive" an object by calling its member functionswithout knowing how the class is implemented. In this sense, main is referred to as a(n) ________ program.
a. manipulator
b. driver
c. controller
d. operator
Q:
C++ is a(n) ________ programming language because you can define new class types as needed.
a. strongly typed
b. extensible
c. inextensible
d. None of the above.
Q:
Each class you create becomes a new ________ you can use to declare variables and create objects.
a. variable
b. object
c. type
d. access modifier
Q:
Each of the following is a relational or equality operator except:
a. <=
b. =!
c. ==
d. >
Q:
Which of the following is a compilation error?
a. Neglecting to declare a local variable in a function before it is used.
b. Using a triple equals sign instead of a double equals sign in the condition of an if statement.
c. Omitting the left and right parentheses for the condition of an if statement.
d. All of the above.
Q:
What will be the output after the following C++ statements have been executed?
int a{4};
int b{12};
int c{37};
int d{51};
if (a < b) {
cout << "a < b" << endl;
}
if (a > b) {
cout << "a > b" << endl;
}
if (d <= c) {
cout << "d <= c" << endl;
}
if (c != d) {
cout << "c != d" << endl;
}
a. a < b
c != d
b. a < b
d <= c
c != d
c. a > b
c != d
d. a < b
c < d
a != b
Q:
Which of the following is not an arithmetic operator?
a. +
b. -
c. =
d. %
Q:
In what order would the following operators be evaluated
-, *, /, +, %
Assume that if two operations have the same precedence, the one listed first will be evaluated first.
a. +, -, /, *, %
b. -, +, %, *, /
c. -, *, %, +, /
d. *, /, %, -, +
Q:
What is the value of result after the following C++ statements execute?
int a{4};
int b{12};
int c{37};
int d{51};
int result{d % a * c + a % b + a};
a. 119
b. 51
c. 127
d. 59
Q:
Which of the following statements could potentially change the value of number2?
a. std::cin >> number2;
b. sum = number1 + number2;
c. number1 = number2;
d. std::cout << number2;
Q:
Which of the following statements does not overwrite a preexisting value stored in a memory location?
a. int a;
b. number = 12;
c. y = y + 2;
d. width = length;
Q:
Which of the following uses C++11's list initialization to initialize count to 0?
a. int count = 0;
b. int count[0];
c. int count(0);
d. int count{0};
Q:
The std::endl stream manipulator________.
a. inputs a newline.
b. flushes the output buffer.
c. outputs a newline and flushes the output buffer.
d. terminates the program.
Q:
The assignment operator ________ assigns the value of the expression on its right to the variable on its left.
a. <-
b. ->
c. =
d. #
Q:
The ________ object enables a program to read data from the user.
a. std::cout.
b. std::cin.
c. std::cread.
d. std::cget.
Q:
Which of the following is a variable declaration statement?
a. int total;
b. #include <iostream>
c. int main()
d. // first string entered by user
Q:
Which of the following code segments prints a single line containing hello there with the words separated by a single space?
a. std::cout << "hello ";
std::cout << " there";
b. std::cout << "hello" , " there";
c. std::cout << "hello";
std::cout << "there";
d. std::cout << "hello";
std::cout << " there";
Q:
Q:
Which is the output of the following statements?
std::cout << "Hello ";
std::cout << "World";
a. Hello World
b. World Hello
c. Hello
World
d. World
Hello
Q:
Which of the following is not a valid C++ identifier?
a. my Value
b. _AAA1
c. width
d. m_x
Q:
Q:
Q:
Which of the following is not a syntax error?a. std::cout << 'Hello world! ';b. std::cout << "Helloworld! ";c. std::cout << "Hello world! ";d. std::cout << Hello world!;
Q:
Which of the following does not cause a syntax error to be reported by the C++ compiler?
a. Mismatched {}.
b. Missing */ in a comment.
c. Missing ; at the end of a statement.
d. Extra blank lines.
Q:
End-of-line comments that should be ignored by the compiler are denoted using:
a. Two forward slashes (//).
b. Three forward slashes (///).
c. A slash and a star (/*).
d. A slash and two stars (/**).
Q:
Which of the following statements about regular expressions is true?
a. They are used to match specific character patterns in text.
b. They can be used to replace parts of one string with another, or to split a string.
c. They can be used to validate data to ensure that it's in a particular format.
d. All of the above statements are true.
Q:
The Boost Libraries ________ pointers help you avoid some key errors associated with traditional pointers.a. openb. regularc. smartd. self-correcting
Q:
Which of the following statements about the Boost Libraries is false?
a. They are free.
b. They are open source.
c. They are peer reviewed and portable.
d. They are automatically included in the latest C++ Standard Library.
Q:
[C++14]: Which of the statements a), b) and c) about C++14 is false?
a. It added several language features.
b. It added several C++ Standard Library Enhancements.
c. It added several bugs from C++11.
d. None of the above statements is false.
Q:
Which of the following is nota goal stated by the creator of C++ for the new C++ standard?a. Make C++ easier to learn.b. Improve library building capabilities.c. Make C++ an open source programming language.d. Increase compatibility with the C programming language.
Q:
Which software product release category is "generally feature complete and supposedly bug free, and ready for use by the community?"
a. Alpha.
b. Beta.
c. Release candidate.
d. Continuous beta.
Q:
________ involves reworking programs to make them clearer and easier to maintain while preserving their correctness and functionality.
a. Object-oriented programming
b. Refactoring
c. Agile software development
d. LAMP
Q:
________ is a communications protocol used to send information over the web.
a. HyperText Markup Language (HTML).
b. URL (Uniform Resource Locator).
c. Web 2.0
d. TCP/IP
Q:
________ helps Internet-based applications perform like desktop applications.
a. Ajax
b. Blogging
c. RSS
d. Mashups
Q:
Which of the following is not a key organization in the open-source community?
a. Apache.
b. SourceForge.
c. Firefox.
d. Eclipse.
Q:
Which of the following statements is false?
a. The concepts of icons, menus and windows were originally developed by Xerox PARC.
b. Windows is an open source operating system.
c. The software that contains the core components of the operating system is called the kernel.
d. Linux source code is available to the public for examination and modification.
Q:
The linker links:a. The source code with the object code.b. The object code with the libraries.c. The executable code with primary memory.d. The primary memory with the CPU.
Q:
The creates object code and stores it on disk.
a. Interpreter.
b. Compiler.
c. Preprocessor.
d. Loader.
Q:
Which statement is false?
a. Classes are reusable software components.
b. A class is to an object as a blueprint is to a house.
c. Performing a task in a program requires a method.
d. A class is an instance of its object.
Q:
________ models software in terms similar to those that people use to describe real-world objects.
a. Object-oriented programming
b. Object-oriented design
c. Procedural programming
d. None of the above
Q:
________ is a graphical language that allows people who design software systems to use an industry standard notation to represent them.
a. The Unified Graphical Language
b. The Unified Design Language
c. The Unified Modeling Language
d. None of the above
Q:
Which language was developed by Microsoft in the early 1990s to simplify the development of Windows applications?
a. Visual C#.
b. Python.
c. Objective-C.
d. Visual Basic.
Q:
Which of the following languages is used primarily for scientific and engineering applications?
a. Fortran.
b. COBOL.
c. Pascal.
d. Basic.
Q:
Today, virtually all new major operating systems are written in:
a. Objective-C.
b. C or C++.
c. Visual C#.
d. Ada.
Q:
C++ provides a number of features that "spruce up" the C language, but more importantly, it provides capabilities for ________ that were inspired by the Simula simulation programming language.
a. structured programming
b. simulation
c. object-oriented programming
d. None of the above.
Q:
Which of the following statements about the C programming language is false?a. C was implemented in 1972 by Dennis Ritchie at Bell Laboratories.b. With careful design, it's possible to write C programs that are portable to most computers.c. C initially became widely known as the Windows operating system's development language.d. Today, most of the code for general-purpose operating systems is written in C or C++.
Q:
Which of the following statements is true?
a. Interpreted programs run faster than compiled programs.
b. Compilers translate high-level language programs into machine language programs.
c. Interpreter programs typically use machine language as input.
d. None of the above.
Q:
Which of the following is not one of the three general types of computer languages?
a. Machine languages.
b. Assembly languages.
c. High-Level languages.
d. Spoken languages.
Q:
Which of the following data items are arranged from the smallest to the largest in the data hierarchy.
a. records, characters, fields, bits, files.
b. bits, files, fields, records, characters.
c. fields, characters, bits, files, records.
d. bits, characters, fields, records, files.
Q:
Which of the following statements is false?
a. The impressive functions performed by computers involve only the simplest manipulations of 1s and 2s.
b. ASCII is a popular subset of Unicode.
c. Fields are composed of characters or bytes.
d. On some operating systems, a file is viewed simply as a sequence of bytes.
Q:
Which of the following statements is false?
a. Speaking to your computer is a form of input.
b. Playing a video is an example of output.
c. A multi-core processor implements several processors on a single integrated-circuit chip.
d. Information in the memory unit is persistentit is retained when the computer's power is turned off.