C++ Chap 9 And 13

76 Questions  I  By Clilfellac on April 25, 2013

  
Changes are done, please start the quiz.


Question Excerpt

Removing question excerpt is a premium feature

Upgrade and get a lot more done!
1.  Each byte in memory is assigned a unique __________.
2.  The __________ operator can be used to determine a variable's address
3.  _____________ variables are designed to hold addresses.
4.  The ____________ operator can be used to work with the variable a pointer points to.
5.  Array names can be used as _____________, and vice versa.
6.  Creating variables while a program is running is called __________.
7.  The __________ operator is used to dynamically allocate memory.
8.  Under older compilers, if the new operator cannot allocate the amount of memory  requested, it returns __________.
9.  A pointer that contains the address 0 is called a(n) __________ pointer.
10.  When a program is finished with a chunk of dynamically allocated memory, it should  free it with the __________ operator.
11.  You should only use pointers with delete that were previously used with  __________.
12.  34. The & symbol is called the indirection operator.
A.
B.
13.  35. The & operator dereferences a pointer.
A.
B.
14.  36. When the indirection operator is used with a pointer variable, you are actually working with the value the pointer is pointing to.
A.
B.
15.  37. Array names cannot be dereferenced with the indirection operator.
A.
B.
16.  38. When you add a value to a pointer, you are actually adding that number times the size of the data type referenced by the pointer. erator.
A.
B.
17.  39. The address operator is not needed to assign an arrays address to a pointer.  
A.
B.
18.  40. You can change the address that an array name points to.  
A.
B.
19.  41. Any mathematical operation, including multiplication and division, may be performed on a pointer.
A.
B.
20.  42. Pointers may be compared using the relational operators.  
A.
B.
21.  43. When used as function parameters, reference variables are much easier to work with than pointers.  
A.
B.
22.  44. The new operator dynamically allocates memory.
A.
B.
23.  45. A pointer variable that has not been initialized is called a null pointer.  
A.
B.
24.  46. The address 0 is generally considered unusable.  
A.
B.
25.  47. In using a pointer with the delete operator, it is not necessary for the pointer to have been previously used with the new operator.
A.
B.
26.  31. Each byte of memory is assigned a unique address.  
A.
B.
27.  32. The * operator is used to get the address of a variable
A.
B.
28.  33. Pointer variables are designed to hold addresses.
A.
B.
29.  17. The two common programming methods in practice today are _________ and _________.  
30.  18. _________ programming is centered around functions or procedures.  
31.  19. _________ programming is centered around objects.  
32.    20. _________ is an object s ability to contain and manipulate its own data.  
33.  21. In C++ the _________ is the construct primarily used to create objects.
34.  22. A class is very similar to a(n) _________.  
35.  23. A(n) _________ is a key word inside a class declaration that establishes a member s   
36.  24. The default access specification of class members is _________.  
37.  25. The default access specification of a struct in C++ is _________.  
38.  26. Defining a class object is often called the _________ of a class.
39.  27. Members of a class object may be accessed through a pointer to the object by using  the _________ operator.  
40.  28. If you were writing the declaration of a class named Canine, what would you name  the file it was stored in? _________  
41.  29. If you were writing the external definitions of the Canine class s member functions,  you would save them in a file named _________.  
42.    30. When a member function s body is written inside a class declaration, the function is  _________.  
43.  31. A(n) _________ is automatically called when an object is created.
44.  32. A(n) _________ is a member function with the same name as the class.  
45.  33. _________ are useful for performing initialization or setup routines in a class object.  
46.  34. Constructors cannot have a(n) _________ type.  
47.  35. A(n) _________ constructor is one that requires no arguments. .
48.  36. A(n) _________ is a member function that is automatically called when an object is  destroyed.
49.  37. A destructor has the same name as the class, but is preceded by a(n) _________ character.  
50.  38. Like constructors, destructors cannot have a(n) _________ type.  
51.  39. A constructor whose arguments all have default values is a(n) _________ constructor.  
52.  40. A class may have more than one constructor, as long as each has a different  _________.  
53.  41. A class may only have one default _________ and one _________.  
54.  42. A(n) _________ may be used to pass arguments to the constructors of elements in an  object array.
55.  51. Private members must be declared before public members.  
A.
B.
56.  52. Class members are private by default.  
A.
B.
57.  53. Members of a struct are private by default.  
A.
B.
58.  54. Classes and structures in C++ are very similar.  
A.
B.
59.    55. All private members of a class must be declared together.  
A.
B.
60.  56. All public members of a class must be declared together.  
A.
B.
61.  57. It is legal to define a pointer to a class object.  
A.
B.
62.  58. You can use the new operator to dynamically allocate an instance of a class.  
A.
B.
63.  59. A private member function may be called from a statement outside the class, as long as the statement is in the same program as the class declaration.  
A.
B.
64.  60. Constructors do not have to have the same name as the class.
A.
B.
65.  61. Constructors may not have a return type.  
A.
B.
66.  62. Constructors cannot take arguments.  
A.
B.
67.  63. Destructors cannot take arguments.  
A.
B.
68.  64. Destructors may return a value.  
A.
B.
69.  65. Constructors may have default arguments.  
A.
B.
70.  66. Member functions may be overloaded.  
A.
B.
71.  67. Constructors may not be overloaded.  
A.
B.
72.  68. A class may not have a constructor with no parameter list, and a constructor whose arguments all have default values.  
A.
B.
73.  69. A class may only have one destructor.  
A.
B.
74.  70. When an array of objects is defined, the constructor is only called for the first element.  
A.
B.
75.  71. To find the classes needed for an object-oriented application, you identify all of the verbs in a description of the problem domain.  
A.
B.
76.  72. A classes responsibilities are the things the class is responsible for knowing, and actions the class must perform.
A.
B.
Back to top


to post comments.

Removing ad is a premium feature

Upgrade and get a lot more done!
Take Another Quiz