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

1. Name two major benefits of object programming. 2. Every class definition cont

ID: 3711882 • Letter: 1

Question

1. Name two major benefits of object programming. 2. Every class definition contains the keyword 3. A class definition is typically stored in a file with thefilename extension. 4. Class members are accessed via the followed immediately by the class's name. operator in conjunction with the name of an object (or reference to an object) of the class or via the operator in conjunction with a pointer to an object of the class 5. Class members specified asare accessible only to member functions of the class and friends of the class. 6. A nonmember function must be declared as a(n) 7. The reclaimed by the 8. A(n), 9. Keyword of a class to have access to that class's private members. operator dynamically allocates memory for an object of a specified type and returns a to that type. The memory is later operator. data member represent class-wide information. introduces an overloaded operator function definition. 10. What are the benefits of separating a simple C+ program into 3 separate files? Elaborate each of your reason with examples

Explanation / Answer

Two major benef its of object programing :: Code Reusability: Objects created for Object Oriented Programs can easily be reused in other programs. Encapsulation : Objects have the ability to hide certain parts of themselves from programmers. This prevents programmers from tampering with values they shouldn't. Every class definition contains the keyword class followed immediately by the class name. the syntax for class definition is class class_name_here { //class data }; hence class is the keyword used before the class name. A class definition is typically stored in a file with .h filename extension. .h files are said to be header files. these contain the class definitions. hence answer os .h extension Class members are accessed via the . operator in conjunction with the name of an object (or reference to an object) of class, or via the ->   operator in conjunction with a pointer to an object of the class. example ::: object_name.variable_name example ::: object_name->pointer_variable_name Class members specified as protected are accessible only to member functions of the class and friends of the class. A nonmember function must be declared as a(n) friend of class to have access to that class's private members. The new operator directly allocates memory for an object of specified type and returns a pointer to that type.The memory is later reclaimed by the = operator. A static data member represent class-wide information. Keyword operator introduces an overloaded operator function definition. What are the benefits of separating a Simple C++ program into 3 separate files? Elaborate each of your reason with examples. it is very useful if we devide a program into parts and store in 3 seperate files. we can store the similar function in a file. we can stoere the driver function in another file. So,whenever we want to import specific funtion from specific class. we can import the only file which we want to import. This reduces the imorting of unwanted functions.