Login
Quizgoat
Find your answers, solutions and more...
We made it much easier for you to find exactly what you're looking for on Quizgoat.
Loading...
Computer Science & Information Technology - Programming. Quiz Level 1
1
Free
Which of the following statements is false?
in
Computer Science & Information Technology
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.
programming
c. An uninitialized fundamental-type variable is implicitly initialized to zero.
2
Free
Which of the following statements is false?
in
Computer Science & Information Technology
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.
programming
a. A constructor that specifies a single parameter should be declared implicit.
3
Free
The ________ statement acts like a chain of if statements. Each performs its test, one after the other, until one of them is found to be true or until the construct is exited without any test ever evaluating to true.
in
Computer Science & Information Technology
A) if/then
B) if/else
C) if/else if
D) if/not if
E) if/end if
programming
C) if/else if
4
Free
Normally, constructors are ________.
in
Computer Science & Information Technology
a. private
b. protected
c. privy
d. public
programming
d. public
5
Free
Which of the following statements is false?
in
Computer Science & Information Technology
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.
programming
d. A constructor cannot specify parameters.
6
d. The UML models operations by listing the operation name preceded by an access modifier. A(n) ________ indicates a public operation in the UML.
in
Computer Science & Information Technology
a. -
b. +
c. p
d. *
programming
7
The ________ statement executes one statement, or block of statements, if a condition is true and skips it, doing nothing, if the condition is false.
in
Computer Science & Information Technology
A) if
B) if/else
C) if/else if
D) switch
E) if/end if
programming
8
Which statement about UML class diagrams is true?
in
Computer Science & Information Technology
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.
programming
9
Which of the following statements is false?
in
Computer Science & Information Technology
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.
programming
10
The ________ operator is used in C++ to test for equality.
in
Computer Science & Information Technology
A) =
B) <>
C) &&
D) ==
E) ||
programming
11
Which of the following statements is false?
in
Computer Science & Information Technology
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.
programming
12
The expression x < y is called a(n) ________ expression.
in
Computer Science & Information Technology
A) arithmetic
B) logical
C) relational
D) comparison
E) binary
programming
13
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.
in
Computer Science & Information Technology
a. final
b. const
c. firm
d. immutable
programming
14
The ________ statement passes a value back to a function’s caller.
in
Computer Science & Information Technology
a. recover
b. restore
c. pass
d. return
programming
15
Which of the following correctly declares an enumerated data type named student?
in
Computer Science & Information Technology
A) enum student { Bill, Tom, Mary };
B) enum student { "Bill", "Tom", "Mary" };
C) int Bill = 1, Tom = 2, Mary = 3; enum student { 1, 2, 3 };
D) Any of the above 3 methods will work.
E) None of the above 3 methods will work.
programming
16
Which of the following statements is false?
in
Computer Science & Information Technology
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.
programming
17
Which of the following statements is false?
in
Computer Science & Information Technology
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.
programming
18
If a switch statement has no ________ statements, the program "falls through" all of the statements below the one with the matching case expression.
in
Computer Science & Information Technology
A) break
B) exit
C) case
D) default
E) relational
programming
Recent Packs
cjs238
Criminal Law
2
items
by
anonymous
Nursing - Management Pace 4 Quiz
22
items
by
lorna
Quiz Facts 3- Business Finance
21
items
by
quincyaj
no-tag
Let Quiz 3/Business - Business Communications
28
items
by
Victoria
couc 510
Theories of Counseling Quiz 2
19
items
by
Caitlin
no-tag
ccj 4660
Criminal Justice - Crime Violence and Schools QuixDoc 2
21
items
by
daisy
no-tag
Quiz Facts 8. Psychology - The Biological Perspective
25
items
by
Bama6907
no-tag
Communication - Writing Negative Messages Quiz level 3
28
items
by
kerbeline
no-tag
Quiz of Gerontology - Aging Matters
28
items
by
Dr-Doom
Exam 1 - Abnormal Psychology
17
items
by
wwdddxxzz
no-tag
Quiz Facts 8. History - U.S Government
24
items
by
Nagazaki
no-tag
Quiz Cocktail for next week
28
items
by
MindGraft
no-tag
hdfs 276
Pre Exam Quiz 5; Human Development and Family Studies
18
items
by
ledia
no-tag
Quiz Preview 10/ Psychology - Principles of Social Psychology
19
items
by
ruffles85
Quiz Facts 7' Psychology - Cognitive Functioning
28
items
by
Erbear64
no-tag
Quiz Facts 10- Psychology - No Tag
16
items
by
Michi
no-tag
psyc 305
Quiz Lot 2. Cognitive Psychology Overview of Theory
27
items
by
marzolam01
no-tag
Easy Quiz 2. Psychology - What is Psychology?
28
items
by
TriDelt
no-tag
Cognitive Psychology - Memory. Quiz Grade 2
21
items
by
Halter_Soni
Pre School Quiz 4-Biology & Microbiology - Genome,genetics,anatomy And Physiology
16
items
by
Debbie
molecular-and-microbiology
A message will be sent to your email address with instructions
Email or Username:
Join us and prepare for your exams!
Username:
Email:
Password:
Already a member?
Log in
Welcome!
Email or Username:
Password:
Remember me on this computer
I forgot my password
Not a member?
Sign up
...