Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Very simple for someone who knows C++. Please answer all of them. Make the funct

ID: 2247540 • Letter: V

Question

Very simple for someone who knows C++. Please answer all of them.

Make the function header provided below into a const member function of CLASS Assume CLASS member functions are defined in a separate Class.cpp source file. void Function (int x) { // Do "stuff" with * that and x, but do not do "stuff" to * this } (Continuing 9) Function() is a _____ CLASS Member function. Check all correct answers! constructor destructor mutator accessor utility (Continuing 9) How many operators are used to make the reference to the member function Function() found in the compound statement (block) shown below? Circle the operators you counted. A: 0 B: 1 C: 2 D: 3 E: none of these CLASS c: // define object/c.Function(3): // use c as handle to reference Function () T or F? The same statement which defines c also implicitly references the CLASS default constructor. Assume the statement which defines the object c also dynamically-allocates heap memory space to represent 1 or more of the c data members. T or F? To maintain its "good heap citizen award", CLASS must define a destructor member function which dynamically-deallocates the heap space which was dynamically-allocated when c was constructed. A function header contains definitions of for _____ parameters, whereas a reference to a function contains a comma-separated list of act _____ parameter expressions (also called arguments.) Fact The number and order of actual parameters must exactly match the number and order of formal parameters found in the parameter list of the called function. T or F? The actual parameter data types must always exactly match with the data types of the corresponding formal parameters. What is this? Answer "this is a pointer to..." Fact The scope of an identifier is that portion of code in which the identifier can be legitimately used (legally be referenced). What is the scope of the local variable c?

Explanation / Answer

9. The function header should be:
        void Function(int x) const {
        }
   Change should be done in Class.h file and Class.cpp file both

10. Answer is utility

11. Anaswer is B. We are using dot operator to access the menber function.

12. True. Default constructor is getting invoked.

13. The Answer is True.

14. The first blank will be "Formal"( for is already there so only "al" needs to be added), the second blan is "Actual"( act is already there so "ual" should be added)

15. It is True

16. this is a pointer to itself. this refers to the same object in which it is being used.

17. The scope of the local variable is the block {} in which it is defined.