Carefully define mutator and accessor functions of a class.

What will be an ideal response?


A mutator function allows the class author to control changes to class data, even filtering out bad data. An accessor function allows the class author to control access to class data and the format of the presentation.

Computer Science & Information Technology

You might also like to view...

Show the output of the following code:

``` #include #include using namespace std; class A { public: A(): i(5), s("abc") { }; int i; // Declare a data field of the int type string s; //Declare a data field of the string type }; int main() { A a; cout << "s is " << a.s.data() << endl; cout << "i is " << a.i << endl; return 0; } ```

Computer Science & Information Technology

What is the role of a computer system’s clock generator?

a) It keeps track of the current date and time. b) It provides power for the computer’s internal clock. c) It sets the frequency at which buses in the system transfer data. d) Both a) and c)

Computer Science & Information Technology

A(n) ________ is a preformatted file that is designed for a specific purpose which can be reused repeatedly

Fill in the blank(s) with correct word

Computer Science & Information Technology

A(n) ____ is a method that is activated when the trigger occurs.

A. exploit handler B. incident handler C. episode trigger D. event handler

Computer Science & Information Technology