ARRAY 1
STRING 1
ARRAY 2
STRING 2
500 POINTS
100

a collection of similar data type value in a single _____.

array

100

String is a collection of group of character, it is achieved in C++ language by using array character. The string in C++ language is a one dimensional array of character which is terminated by a null character. What is the symbol for null character?

\0

100

It is a derived data type in C++, which is constructed from the fundamental data type of _____ language.

C++

100

What is the purpose of strcat(s1);?

Concatenates string s2 onto the end of string s1

100

What is the simplest form of an array?

one-dimension

200

The lowest address corresponds to the _____ and the _____ address to the last element.

first element, highest

200

Enumerate the two types of String.

1. C-Style Character String

2. String Class in C++

200

An array is used to store a collection of _____.

data
200

What is the purpose of strlen(s1);?

Returns the length of string s1.

200

What is the syntax to declare two-dimensional array is C++?

data type array_name[][];

300

The first digital computers used _____ language programming to set up and access array structures for data tables, vector and matrix computations, and for many other purposes.

machine

300

This string is actually a one-dimensional array of characters which is terminated by a null character ‘\0’.

C-Style Character String

300

Enumerate at least three (3) programming languages that were mentioned or discussed in Lesson 1: Array.

FORTRAN (1957)

LISP (1958)

COBOL (1960)

ALGOL 60(1960)

C (1972)

C++ (1983)

300

By using strcmp(s1, s2), what is the output if the value of s1 and s2 are the same?

0

300

What is the general form to initialize values to one-dimensional array in C++?

data_type array_name[array_size] = {comma_separated_element_list};

400

Dr. _____ wrote the first array – sorting program (merge sort) in 1945, during the building of the first stored-program computer.

Jon Von Neumann

400

What is the purpose of strcpy(s1,s2);?

Copies string s2 into string s1.

400

What are the two (2) statements that can be used to determine the partial or the complete flow in programs?

IF STATEMENTS

SWITCH CASE STATEMENTS

400

By using strcmp(s1, s2), what is the output if the value of s1 is greater than s2?

1

400

What is the purpose of strcmp(s1, s2);?

Returns 0 if s1 and s2 are the same; less than 0 if s1<s2; greater than 0 if s1>s2.

500

ADVANTAGES OF ARRAY
Less code is required, one variable can store numbers of value.

Code Optimization

500

What is the general form to declare string in C++?

char string_name[string_size];

or

string string_name[string_size];

500

ADVANTAGES OF ARRAY
With the help of array index you can randomly access any elements from the array.

Random Access

500

By using strcmp(s1, s2), what is the output if the value of s1 is lesser than s2?

-1

500

What is the reason why null character '\0' is optional?

The C++ compiler automatically places the ‘\0’ (null character) at the end of the string when it initializes the array.