Answers to Self-Review Exercises

  1. 3.1

    1. class.

    2. .h.

    3. type, name.

    4. data member.

    5. access specifier.

    6. void.

    7. getline.

    8. #include.

  2. 3.2

    1. False. Function names begin with a lowercase letter and all subsequent words in the name begin with a capital letter.

    2. True.

    3. True.

    4. False. Such variables are local variables and can be used only in the member function in which they’re declared.

    5. True.

    6. True.

  3. 3.3 A local variable is declared in the body of a function and can be used only from its declaration to the closing brace of the block in which it’s declared. A data member is declared in a class, but not in the body of any of the class’s member functions. Every object of a class has each of the class’s data members. Data members are accessible to all member functions of the class.

  4. 3.4 A parameter represents additional information that a function requires to perform its task. Each parameter required by a function is specified in the function header. An argument is the value supplied in the function call. When the function is called, the argument value is passed into the function parameter so that the function can perform its task.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset