Answer the following questions true (T) or false (F)

1. In a sorting an array, the items in the array are rearranged so that
for all j and k, if j < k, then array[j]<=array[k]

2. In the definition, double d[10] = {0.0}; only d[0] is initialized to zero, the rest are uninitialized, just like x in the definition double x;


1. True
Explanation: This is sorting into increasing order. This ignores sorting into decreasing order. Care should be taken not to compare elements with index values out of the range 0 to declared_size-1
2. False
Explanation: The ISO C++ Standard requires that a Standard compliant compiler with an initializer list initialize the excess array elements to a zero value appropriate to the base array type. Most compilers comply.

Computer Science & Information Technology

You might also like to view...

Which statement about class unique_ptr (of the new C++ standard) and dynamic memory allocation is false?

a. An object of class unique_ptr maintains a pointer to dynamically allocated memory. b. When a unique_ptr object destructor is called (for example, when a unique_ptr object goes out of scope), it performs a destroy operation on its pointer data member. c. Class template unique_ptr provides overloaded operators * and -> so that a unique_ptr object can be used just as a regular pointer variable is. d. Class unique_ptr is part of the new C++ standard and it replaces the deprecated auto_ptr class.

Computer Science & Information Technology

____________________ is the use of fraudulent Web sites and e-mail links to trick people into revealing sensitive, personal, and financial information.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which case of the following would warrant using the boolean logical inclusive OR (|) rather than the conditional OR (||)?

a. Testing if two conditions are both true. b. Testing if at least one of two conditions is true. c. Testing if at least one of two conditions is true when the right operand has a required side effect. d. Testing if at least one of two conditions is true when the left operand has a required side effect.

Computer Science & Information Technology

? ?In a data entry screen, such as that shown in the accompanying figure, a(n) _____ is a control feature that is used to represent on or off status and switches to the other status when clicked.

A. ?command button B. ?option button C. ?toggle button D. ?help button

Computer Science & Information Technology