Exam Com Prog Sample
Exam Com Prog Sample
Exam Com Prog Sample
7.) 2.5 1.25 3.5 2.0 5.0, which index position is 3.5?
a.) 2 b.) 1 c.) 0
8.) _________ is an array having a single index value to represent the array elements.
11.)In C++, indexes should be a non-negative integer with zero as the index of the first element in
the array and one less than the size of the array (n-1) as the index of the last element.
a.) non-negative integer, zero, one less, (n-1)
b.) any integer, zero, zero loss, (n-0)
13.) _______ happens when you assign a value to a variable in the same statement in which you
declare that variable.
a.) Initialization b.) Declaration c.) Assignment
14.) type array_name[array_size]={element1, element2, … , element}; is the syntax for initializing a
____________
15.)The syntax for initializing a one-dimensional array is similar to the declaration except that it is
followed by the _____ and the _____
a.) assignment operator ( = ) and a comma-separated list of values b.) equal sign and dot-
operator
16.) double arr[5]={1.5, 2.0, 2.5, 3.0, 5.0};
int score[3] = { 74, 87, 91, 93 };
a.) first, second, and last b.) first, second, third, and last c.) second, third and last
35.)______ is a collection of variables referenced under one name, providing a convenient means of
keeping related information together.
type member-name;
.. .
} structure-variables;
.. .
} structure-variables;
41.)Individual members of a structure are accessed through the use of the
a.) Dot operator b.) Index c.) Initializer
42.)The general form for accessing a member of a structure is
a.) structure-name.member-name. b.) structure-.member.
43.)What rules of initialization does structure follow?
a.) Initialization of array b.) Variable initialization
44.)What string operation can we use to assign a new value to a member in a structure?
a.) stcrcpy b.) strlen
45.)Structures can be declared as blank also.
a.) array b.) structures within a structure
46.)You can pass the entire structure as a function argument just like the way you pass any other
variable or pointer. You can also create a function that returns a structure type.
a.) function argument and structure type b.) function and value c.) variable and value
47.) _______ models real world objects.
a.) Object-oriented approach b.) Attributes
48.)______ in real world corresponds to data in a program.
a.) Attribute b.) Object C.) Classes
49.)_____ are something a real world object does in response to a stimulus or an event.
a.) Behaviors b.) Classes
50.)______ is created that serves as a template of the similar objects.
a.) Class B.) Objects
51.)______ are blueprints of objects.
A.) Class B.) Objects
52.)class ClassName
class body
}; is the syntax for :
a.) class b.) structure c.) arrays
Test ii