// Copyright Amruth N. Kumar, amruth@computer.org // Master template // // CAUTION: DO NOT USE SAME ORDINALITY FOR A STRUCTURE AND A CLASS IN THE SAME PROGRAM // ALSO: DO NOT USE C0 - RESERVED FOR DEFAULT WRAPPER CLASS // // Template C++ Java/C# // ----------------------------------------------------------------------------------------------- // ; Student amruth; Student amruth; // Declaration+Allocation Declaration // (Parameters) (Parameters, null pointer problems) // // = (); Student amruth; Student amruth = new Student(); // Declaration+Allocation Declaration+Allocation // (Objects in clients) (Objects in clients) // // = (); Student amruth = new GradStudent(); // Declaration+Allocation // // ; Student * amruth; // Declaration // // = (); Student * amruth = new Student(); // Declaration+Allocation // // = (); Student * amruth = new GradStudent(); // Declaration+Allocation // // Note: means 's 's selector (x=0) or mutator (x=1) // means 's constructor (x=0) or destructor (x=1) // Proposed: means 's that is neither a selector nor a mutator - // notation that can be used to have derived class function call base class function of same name // instead of using or <*1> notation.. // To call base class 's function from derived class : // Constructor: // (){ (); } // Selector/Mutator: // Note: does not have its own , it inherits it and should be treated as such // (){ return (); } // ( ){ ( ); } // as opposed to calling itself recursively: // ( ){ if( > 0 ) ( - 1 ); } // So, no need for or <*1> // Unless base class and derived class have same function which is neither a selector nor mutator? // May be use the notation , for 's non-data-member-specific ? // In the following, (B) stands for behavior/output, (D) for debug // --------------------------------------------------------------------------------- // // VARIABLES AND FUNCTIONS OF AN OBJECT // // // Accessing public (B) data member by client - 100 // Object.Variable.Public.By Client // // Accessing protected (D) data member by client - 125 // // Object.Variable.Protected.By Client // Object.Variable.Protected.Client code does not have access to protected data member of the object // // Accessing private (D) data member by client - 150 // // Object.Variable.Private.By Client // Object.Variable.Private.Client code does not have access to private data member of the object // // // All functions public // // Accessing public (B) data member by dynamic member function - 200 // Object.Variable.Public.By Object Function // // Accessing protected (B) data member by dynamic member function - 225 // Object.Variable.Protected.By Object Function // // Accessing private (B) data member by dynamic member function - 250 // Object.Variable.Private.By Object Function // // // Accessing dynamic public data member with respect to the class - 275 // OOP.Object.Variable.The variable is not a static member of the class, and cannot be accessed with respect to the class // // // All public member functions // // Accessing public (B) member function by client // // Object.Function.Public.By Client - Further expanded below // // Accessing protected (D) member function by client - 300 // // Object.Function.Protected.By Client // Object.Function.Protected.Client code does not have access to protected member function of the object // // Accessing private (D) member function by client - 325 // // Object.Function.Private.By Client // Object.Function.Private.Client code does not have access to private member function of the object // // TO DO? // Accessing dynamic public function with respect to the class - 350? // OOP.Object.Function.The function is not a static member of the class, and cannot be accessed with respect to the class // // Execution of constructor code (B) wrt object - 400 // Object.Constructor.By Client // // Execution of constructor with one or more parameters - 425 // Object.Initialization.Basic object // TO DO - RENAME // // Execution of constructor with incorrect number of parameters - 450 // Object.Constructor.Number of actual parameters in the call not equal to the number of formal parameters in the definition // TO DO - RENAME // // Execution of constructor with incorrect data types for parameters - 475 // Object.Constructor.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition // // Execution of selectors (B) wrt object - 500 // Object.Selector.By Client // TO DO - RENAME // Ignore this error - No, Keep // // Value returned by the selector is ignored by the caller - 525 // Object.Selector.Value returned by the function is ignored by the caller // TO DO - RENAME // Error only for C++ // // Selector is called before data member is initialized - 550 // Object.Selector.Referencing variable before initializing its value // TO DO - WHY IS THIS UNDER SELECTOR? WE ARE NOT USING ANY SELECTORS HERE! // // Execution of mutators (B) wrt object - 600 // Object.Mutator.By Client // TO DO - RENAME // Ignore // // Value returned by the mutator is ignored by the caller - 625 // Object.Mutator.Value returned by the function is ignored by the caller // TO DO - RENAME // Ignore - No, keep? // // Mutator is called with incorrect number of parameters - 650 // Object.Mutator.Number of actual parameters in the call not equal to the number of formal parameters in the definition // TO DO - RENAME // Ignore // // Mutator is called with incorrect data type for parameters - 675 // Object.Mutator.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition // Only C++, C#, Not for Java // // Execution of destructor code (B) wrt object - 700 // Object.Destructor.By Client // // Assigning an object to class instead of another object - 800 // // Object.Assignment.Aggregate.Assigning to class // Object.Assignment.Aggregate.Object cannot be assigned to a class // // Aggregate assignment from one object to another - 825 // Object.Assignment.Aggregate.Assigning object to variable // // Object passed as parameter to a function where it is accessed - 850 // Object.Parameter.Aggregate.Accessed // // Object passed as parameter to a function where it is modified - 875 // Object.Parameter.Aggregate.Modified // // --------------------------------------------------------------------------------- // // STATIC VARIABLE AND FUNCTION IN A CLASS // // // Accessing dynamic (D) data member by static member function - 300 // // Object.Variable.Public.By Class Function // OOP.Object.Variable.The variable is not a static member of the class, and cannot be accessed in a static function // // Accessing protected (D) data member by static member function // // Object.Variable.Protected.By Class Function // // Accessing private (D) data member by static member function // // Object.Variable.Private.By Class Function // Object.Variable.Private.Class (static) function does not have access to private data member of the object // // // Accessing static public (B) data member by client - 1000 // Class.Variable.Public.Wrt Class // // Accessing static public (B) data member by client - 1025 // Class.Variable.Public.Wrt Object // // Accessing static protected (D) data member by client - 1050 // Class.Variable.Protected.By Client // // Accessing static private (D) data member by client - 1075 // Class.Variable.Private.By Client // // // Accessing static public (B) data member by static member function - 1100 // Class.Variable.Public.By Class Function // // Accessing static protected (B) data member by static member function - 1125 // Class.Variable.Protected.By Class Function // // Accessing static private (B) data member by static member function - 1150 // Class.Variable.Private.By Class Function // // // Accessing static public (D) data member by dynamic member function - 1200 // Class.Variable.Public.By Object Function // // Accessing static protected (D) data member by dynamic member function - 1225 // Class.Variable.Protected.By Object Function // // Accessing static private (D) data member by dynamic member function - 1250 // Class.Variable.Private.By Object Function // // // Accessing static public (B) member function wrt class name by client - 1300 // Class.Function.Public.Wrt Class // // Accessing static public (D) member function wrt object by client - 1325 // Class.Function.Public.Wrt Object // // Accessing static protected (D) member function by client - 1350 // Class.Function.Protected.By Client // // Accessing static private (D) member function by client - 1375 // Class.Function.Private.By Client // // // --------------------------------------------------------------------------------- // // COMPOSITION OF CLASSES // // // Called in Composer function, which is in turn called by client // // Accessing public (B) data member by composing class - 2000 // Object.Variable.Public.By Composer // // Accessing protected (D) data member by composing class - 2025 // Object.Variable.Protected.By Composer // // Accessing private (D) data member by composing class - 2050 // Object.Variable.Private.By Composer // // // Called in Composer function, which is in turn called by client // // Accessing public (B) member function by composing class // // Object.Function.Public.By Composer.Function - Expanded below // // Accessing protected (D) member function by composing class - 2100 // Object.Function.Protected.By Composer // // Accessing private (D) member function by composing class - 2125 // Object.Function.Private.By Composer // // // Execution of constructor code (B) by composing class constructor - 2200 // Object.Constructor.By Composer // // Calling constructor with arguments, some of which are used to initialize composed object - 2225 // Object.Initialization.Composed object // // Execution of selectors (B) by composing class function - 2250 // Object.Selector.By Composer // // Execution of mutators (B) by composing class function - 2275 // Object.Mutator.By Composer // // Execution of destructor code (B) by composing class destructor - 2300 // Object.Destructor.By Composer // // // Accessing public (D) data member wrt composing object by client - 2400 // Object.Variable.Public.Wrt Composer // // Accessing protected (D) data member wrt composing object by client - 2425 // Object.Variable.Protected.Wrt Composer // // Accessing private (D) data member wrt composing object by client - 2450 // Object.Variable.Private.Wrt Composer // // // Accessing public (D) member function wrt composing object by client - 2500 // Object.Function.Public.Wrt Composer // // Accessing protected (D) member function wrt composing object by client - 2525 // Object.Function.Protected.Wrt Composer // // Accessing private (D) member function wrt composing object by client - 2550 // Object.Function.Private.Wrt Composer // // Following are for chained dot operator, where operands are both member function calls // Elsewhere, we see chained dot operators, where one operand is a data member // // Object is returned by a function, which is then accessed - 2600 // Object.Returned.By Composer // Calling selector/mutator w.r.t object returned by Composer // // --------------------------------------------------------------------------------- // // PUBLIC INHERITANCE // // // Called in inheritor function, which is in turn called by client // // Accessing public (B) data member by inheriting class - 3000 // Object.Variable.Public.By Inheritor // // Accessing protected (B) data member by inheriting class - 3025 // Object.Variable.Protected.By Inheritor // // Accessing private (D) data member by inheriting class - 3050 // Object.Variable.Private.By Inheritor // // // Called in inheritor function, which is in turn called by client // // Accessing public (B) member function by inheriting class // // Object.Function.Public.By Inheritor.Function - Expanded below // // Accessing protected (B) member function by inheriting class - 3100 // Object.Function.Protected.By Inheritor // // Accessing private (D) member function by inheriting class - 3125 // Object.Function.Private.By Inheritor // // // Accessing public (B) data member wrt inheriting object by client - 3200 // Object.Variable.Public.Wrt Inheritor // // Accessing protected (D) data member wrt inheriting object by client - 3225 // Object.Variable.Protected.Wrt Inheritor // // Accessing private (D) data member wrt inheriting object by client - 3250 // Object.Variable.Private.Wrt Inheritor // // // Accessing public (B) member function wrt inheriting object by client - 3300 // Object.Function.Public.Wrt Inheritor // // Accessing protected (D) member function wrt inheriting object by client - 3325 // Object.Function.Protected.Wrt Inheritor // // Accessing private (D) member function wrt inheriting object by client - 3350 // Object.Function.Private.Wrt Inheritor // // Execution of constructor code (B) when inheriting class's constructor calls it - 3400 // Object.Constructor.Inheritor.Coopted // // Execution of constructor code (B) when inheriting class's constructor does not call it - 3425 // Object.Constructor.Inheritor.Not Coopted // // Constructor is called with arguments, some of which are passed to base class - 3450 // Object.Initialization.Inherited object // // In each problem, call the overridden function wrt BOTH base and derived class object // // Execution of selectors (B) by inheriting class // // Execution of selectors (B) by client wrt inheriting object which overrides it, calls it and behavior is polymorphic - 3500 // Object.Selector.Inheritor.Overridden.Coopted.Polymorphic // // Execution of selectors (B) by client wrt inheriting object which overrides it, does not call it and behavior is polymorphic - 3525 // Object.Selector.Inheritor.Overridden.Not Coopted.Polymorphic // // Execution of selectors (B) by client wrt inheriting object which does not override - 3550 // Object.Selector.Inheritor.Not Overridden // // Execution of selectors (B) by client wrt inheriting object which overrides it, calls it, and behavior is not polymorphic (C++ only) - 3575 // Object.Selector.Inheritor.Overridden.Coopted.NonPolymorphic // // Execution of selectors (B) by client wrt inheriting object which overrides it, does not call it, and behavior is not polymorphic (C++ only) - 3600 // Object.Selector.Inheritor.Overridden.Not Coopted.NonPolymorphic // // // In each problem, call the overridden function wrt both base and derived class object // // Execution of mutators (B) by inheriting class // // Execution of mutators (B) by client wrt inheriting object which overrides it, calls it and behavior is polymorphic - 3700 // Object.Mutator.Inheritor.Overridden.Coopted.Polymorphic // // Execution of mutators (B) by client wrt inheriting object which overrides it, does not call it and behavior is polymorphic - 3725 // Object.Mutator.Inheritor.Overridden.Not Coopted.Polymorphic // // Execution of mutators (B) by client wrt inheriting object which does not override - 3750 // Object.Mutator.Inheritor.Not Overridden // // Execution of mutators (B) by client wrt inheriting object which overrides it, calls it, and behavior is not polymorphic (C++ only) - 3775 // Object.Mutator.Inheritor.Overridden.Coopted.NonPolymorphic // // Execution of mutators (B) by client wrt inheriting object which overrides it, does not call it, and behavior is not polymorphic (C++ only) - 3800 // Object.Mutator.Inheritor.Overridden.Not Coopted.NonPolymorphic // // // Execution of destructor code (B) by inheriting class's destructor - 3850 // Object.Destructor.By Inheritor // // // Assigning base class object to derived class variable - 3900 // Object.Assignment.Aggregate.Assigning base object to derived variable // // Assigning derived class object to base class variable - 3925 // Object.Assignment.Aggregate.Assigning derived object to base variable // // Assigning object of one derived class to variable of another derived class - 3950 // Object.Assignment.Aggregate.Assigning derived object to different derived variable // --------------------------------------------------------------------------------------- // INVERSE OF INHERITANCE // // Called in inheritor function, which is in turn called by client // // Accessing public (B) data member by ancestral class - 4000 // Object.Variable.Public.By Ancestor // // Accessing protected (B) data member by ancestral class - 4025 // Object.Variable.Protected.By Ancestor // // Accessing private (D) data member by ancestral class - 4050 // Object.Variable.Private.By Ancestor // // // Called in inheritor function, which is in turn called by client // // Accessing public (B) member function by ancestral class - 4100 // Object.Function.Public.By Ancestor // // Accessing protected (B) member function by ancestral class - 4125 // Object.Function.Protected.By Ancestor // // Accessing private (D) member function by ancestral class - 4150 // Object.Function.Private.By Ancestor // // // Accessing public (B) data member wrt ancestral object by client - 4200 // Object.Variable.Public.Wrt Ancestor // // Accessing protected (D) data member wrt ancestral object by client - 4225 // Object.Variable.Protected.Wrt Ancestor // // Accessing private (D) data member wrt ancestral object by client - 4250 // Object.Variable.Private.Wrt Ancestor // // // Accessing public (B) member function wrt ancestral object by client - 4300 // Object.Function.Public.Wrt Ancestor // // Accessing protected (D) member function wrt ancestral object by client - 4325 // Object.Function.Protected.Wrt Ancestor // // Accessing private (D) member function wrt ancestral object by client - 4350 // Object.Function.Private.Wrt Ancestor // Notation: // : // 's constructor (last digit is 0) // In client: // = (); // In composing object's constructor: // = (); // In inheriting object's constructor: // (); // Note: is used as return type in the definition so that TemplateParser.isFunctionHeader() // will properly identify constructor as a function // : // 's destructor (last digit is 1) // Note: is used as return type in the definition so that TemplateParser.isFunctionHeader() // will properly identify destructor as a function // : // 's 's selector (last digit is 0) (Note: may be inherited from 's parent!) // In client: // << .(); // In inheriting object's selector (assuming inherited from ): // return (); // Note: Selector's name is not logged in SymbolTable // : // 's 's mutator (last digit is 1) (Note: may be inherited from 's parent!) // Note: Mutator's name is not logged in SymbolTable // Say is the parent and inherits from it // is defined in and overridden in // In .() definition, (); would be a recursive call. // How do we call 's ()? Use notation , for 's non-data-member-specific ? // --------------------------------------------------------------------------------- // Each problem tests wrt some client code that accesses the data member of member function in question // In the following, (B) stands for behavior/output, (D) for debug // ================================================================================= // // VARIABLES AND FUNCTIONS OF AN OBJECT // --------------------------------------------------------------------------------- // // Accessing public (B) data member by client - 100 // Object.Variable.Public.By Client # 100 OOP.Object.Variable.Public.By Client > {{ public: ; (){return ;} (){=;} protected: private: } (){ = (); . = ; << .; }} > Type: debug_output Hardness: 10 # 101 OOP.Object.Variable.Public.By Client > {{ public: (){<< ;return / 10;} ; (){if( > 0) = 50; else = 10;} protected: private: } (){ = (); = ; . = ; << .; }} > Type: debug_output Hardness: 10 # 102 OOP.Object.Variable.Public.By Client > {{ public: (){return / 2;} (){<< ;= * 2;} ; protected: private: } (){ = ; = (); . = ; << .; }} > Type: debug_output Hardness: 10 // integrated problem - pre # 103 OOP.Object.Variable.Public.By Client > {{ public: (){return --;} ; (){ = ; ++; << ;} protected: private: } (){ = (); . = ; << .; }} > Type: debug_output Hardness: 10 // integrated problem - post # 104 OOP.Object.Variable.Public.By Client > {{ public: ; (){ = / 2; << ; return ;} (){=; = * 2;} protected: private: } (){ = ; = (); . = ; << .; }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (D) data member by client - 125 // Object.Variable.Protected.By Client // Object.Variable.Protected.The variable is protected in the class and cannot be accessed // Old: Client code does not have access to protected data member of the object # 125 OOP.Object.Variable.Protected.The variable is protected in the class and cannot be accessed > {{ public: (){return ;} (){=;} protected: ; private: } (){ = (); . = ; = ; << + 1; }} > Type: debug_output Hardness: 10 # 126 OOP.Object.Variable.Protected.The variable is protected in the class and cannot be accessed > {{ public: (){<< ;return - 10;} (){if( > 0) = + 10; else = 10;} protected: ; private: } (){ = ; = (); . = ; << * 10; }} > Type: debug_output Hardness: 10 # 127 OOP.Object.Variable.Protected.The variable is protected in the class and cannot be accessed > {{ public: (){return / 2;} (){= * 2;<< ;} protected: ; private: } (){ = (); = ; . = ; << / 2; }} > Type: debug_output Hardness: 10 // integrated problem - pre # 128 OOP.Object.Variable.Protected.The variable is protected in the class and cannot be accessed > {{ public: (){return --;} (){ = ; ++; << ;} protected: ; private: } (){ = (); = ; . = ; << + 10; }} > Type: debug_output Hardness: 10 // integrated problem - post # 129 OOP.Object.Variable.Protected.The variable is protected in the class and cannot be accessed > {{ public: (){<< ; = / 2; << ; return ;} (){=; = * 2;} protected: ; private: } (){ = ; = (); . = ; << * 2; }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) data member by client - 150 // Object.Variable.Private.By Client // Object.Variable.Private.The variable is private in the class and cannot be accessed // Old: Client code does not have access to private data member of the object # 150 OOP.Object.Variable.Private.The variable is private in the class and cannot be accessed > {{ public: (){return ;} (){=;} protected: private: ; } (){ = (); . = ; = ; << + ; }} > Type: debug_output Hardness: 10 # 151 OOP.Object.Variable.Private.The variable is private in the class and cannot be accessed > {{ public: (){<< * 2;return - 10;} (){if( > 0) = * 10; else = 0; << ;} protected: private: ; } (){ = ; = (); . = ; << * ; }} > Type: debug_output Hardness: 10 # 152 OOP.Object.Variable.Private.The variable is private in the class and cannot be accessed > {{ public: (){return / 2;} (){= * 10; << ;} protected: private: ; } (){ = (); = ; . = ; << / 10; }} > Type: debug_output Hardness: 10 // integrated - pre # 153 OOP.Object.Variable.Private.The variable is private in the class and cannot be accessed > {{ public: (){--; << ; return ;} (){ = ; ++; << ;} protected: private: ; } (){ = (); = ; . = ; << % 2; }} > Type: debug_output Hardness: 10 // integrated - post # 154 OOP.Object.Variable.Private.The variable is private in the class and cannot be accessed > {{ public: (){ = / 2; << ; return ;} (){=; = * 2; << ;} protected: private: ; } (){ = ; = (); . = ; << / 10 + % 10; }} > Type: debug_output Hardness: 10 // ================================================================================= // // All functions public // --------------------------------------------------------------------------------- // // Accessing public (B) data member by dynamic member function - 200 // Object.Variable.Public.By Object Function # 200 OOP.Object.Variable.Public.By Object Function > {{ public: (){ = ; << ;} (){if( >= 0){ =;} else { = * -1;} << ;} ; protected: private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 # 201 OOP.Object.Variable.Public.By Object Function > {{ public: (){ = ; return ;} (){if( >= ){ = - ;} else { = + ;} << ; << ;} ; protected: private: } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 202 OOP.Object.Variable.Public.By Object Function > {{ public: (){ = ; if( % 2 != 0 ){-- ;} << ;} (){ = ; << ;} ; protected: private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 // integrated - pre # 203 OOP.Object.Variable.Public.By Object Function > {{ public: (){ = ; if( % 2 != 0 ){-- ;} << ;} (){ = ; return ;} ; protected: private: } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 204 OOP.Object.Variable.Public.By Object Function > {{ public: (){ = ; ++ ; -- ; << ; << ;} (){ = ; << ;} ; protected: private: } (){ =; = (); .(); }} > Type: debug_output Hardness: 10 // integrated - post # 205 OOP.Object.Variable.Public.By Object Function > {{ public: (){ = ; << * 2; << / 2; << - ;} (){ = ; return ;} ; protected: private: } (){ = (); =; << .(); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (B) data member by dynamic member function - 225 // Object.Variable.Protected.By Object Function # 225 OOP.Object.Variable.Protected.By Object Function > {{ public: (){ = ; << ;} (){=; << ; *= 5; << ;} protected: ; private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 # 226 OOP.Object.Variable.Protected.By Object Function > {{ public: (){>> ; << ;} (){;for( = 0; < ; ++ )<< ;} protected: ; private: } (){ = (); .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // (){<< ; if( >= ){ = / ;} else { = * ;} << ; } // integrated - pre # 227 OOP.Object.Variable.Protected.By Object Function > {{ public: (){ = ; << ; if( % 2 != 0 ){ /= 2;} << ;} (){ = ; << ;} protected: ; private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 // integrated - post # 228 OOP.Object.Variable.Protected.By Object Function > {{ public: (){do{<< ; = - 1; }while( > 0 );} (){ = ; << ;} protected: ; private: } (){ ; = (); >> ; .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 229 OOP.Object.Variable.Protected.By Object Function > {{ public: (){for( = 0; <= ; ++){ << ; } << ;} (){ = ; << ;} protected: ; private: } (){ =; = (); .(); }} > Type: debug_output Hardness: 10 # 230 OOP.Object.Variable.Protected.By Object Function > {{ public: (){while( > 0 ){ = / 2; << ; }} (){ = ; return ;} protected: ; private: } (){ = (); ; >> ; << .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // (){ = ; do{ << * 2; -= 3; }while( > 0); << ;} // --------------------------------------------------------------------------------- // // Accessing private (B) data member by dynamic member function - 250 // Object.Variable.Private.By Object Function # 250 OOP.Object.Variable.Private.By Object Function > {{ public: (){>> ; << ;} (){;for( = 0; < ; ++ )<< ;} protected: private: ; } (){ = (); .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // (){<< ; = * ; = / 2; << ;} # 251 OOP.Object.Variable.Private.By Object Function > {{ public: (){ = ; return ;} (){ = 0; while( > ){ ++; --; << ; << ; }} protected: private: ; } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 252 OOP.Object.Variable.Private.By Object Function > {{ public: (){ = ; << ; while( < ){ = * ; << ; } } (){ = ; << ;} protected: private: ; } (){ ; = (); >> ; .(); }} > Input: "\n\n" > Type: debug_output Hardness: 10 // integrated - pre # 253 OOP.Object.Variable.Private.By Object Function > {{ public: (){ = ; << ; *= 2; << ; += 3; << ; /= 5; << ;} (){ = ; return ;} protected: private: ; } (){ = (); ; >> ; << .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // integrated - post # 254 OOP.Object.Variable.Private.By Object Function > {{ public: (){ = ; %= 7; << ; %= 5; << ; %= 3; << ; %= 2; << ; } (){ = ; return ;} protected: private: ; } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 255 OOP.Object.Variable.Private.By Object Function > {{ public: (){ = 0; while( > 0 ){ += ; --; } << ;} (){ = ; return ;} protected: private: ; } (){ = (); =; << .(); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing dynamic data member with respect to the class - 275 # 275 OOP.Object.Variable.The variable is not a static member of the class and cannot be accessed with respect to the class > {{ public: ; protected: (){ = ; << ;} (){if( >= 0){ =;} else { = * -1;} } private: } (){ = (); . = ; << ; }} > Type: debug_output Hardness: 10 # 276 OOP.Object.Variable.The variable is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){ = ;} ; protected: (){if( >= ){ = + ;} else { = * ;} << ; } private: } (){ = (); .(); << .; }} > Type: debug_output Hardness: 10 # 277 OOP.Object.Variable.The variable is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){ = ; << ;} ; protected: private: (){ = ; if( % != 0 ){ -= ;} << ;} } (){ = (); .(); << .; }} > Type: debug_output Hardness: 10 # 278 OOP.Object.Variable.The variable is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){ = ; return ;} ; protected: (){ = ; << ; /= ; << ;} private: } (){ = (); << .(); . = + 1; }} > Type: debug_output Hardness: 10 // integrated - pre # 279 OOP.Object.Variable.The variable is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){ = ; << ;} ; protected: private: (){ = ; += ; << ; -= ; << ;} } (){ =; = (); .(); << .; }} > Type: debug_output Hardness: 10 // integrated - post # 280 OOP.Object.Variable.The variable is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){ = ; return ;} ; protected: (){ = ; << + 2; << % 2; << * ;} private: } (){ = (); =; << .(); << .; }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (D) member function by client - 300 // Object.Function.Protected.By Client // Object.Function.Protected.The function is protected in the class and cannot be called // Old: Client code does not have access to protected member function of the object # 300 OOP.Object.Function.Protected.The function is protected in the class and cannot be called > {{ public: ; (){ = ; << ;} protected: (){=; << ; *= ; << ;} private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 # 301 OOP.Object.Function.Protected.The function is protected in the class and cannot be called > {{ public: ; (){ = ; return ;} protected: (){ = ; if( >= ){ = / ;} else { = / ;} << ; } private: } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 302 OOP.Object.Function.Protected.The function is protected in the class and cannot be called > {{ public: (){ = ; << ;} ; protected: (){ = ; << ; switch( % 3 ) { case 0: << ; break; case 1: << - 1; break; default: << - 2; } } private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 // integrated - pre # 303 OOP.Object.Function.Protected.The function is protected in the class and cannot be called > {{ public: (){ = ; return ;} ; protected: (){ = ; while( > 0 ){<< * 2; -= 2;} } private: } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 304 OOP.Object.Function.Protected.The function is protected in the class and cannot be called > {{ public: (){ = ; << ;} ; protected: (){for( = 0; <= ; += 2){ << / 2; } << / 2 + 1;} private: } (){ =; = (); .(); }} > Type: debug_output Hardness: 10 // integrated - post # 305 OOP.Object.Function.Protected.The function is protected in the class and cannot be called > {{ public: (){ = ; return ;} ; protected: (){ = ; do{ << * 3; -= 3; }while( > 0); << / 3;} private: } (){ = (); =; << .(); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) member function by client - 425 // Object.Function.Private.By Client // Object.Function.Private.The function is private in the class and cannot be called // Old: Client code does not have access to private member function of the object # 325 OOP.Object.Function.Private.The function is private in the class and cannot be called > {{ public: ; (){<< ; (); } protected: private: (){ = ; += ; << ;} } (){ = (); .(); }} > Type: debug_output Hardness: 10 # 326 OOP.Object.Function.Private.The function is private in the class and cannot be called > {{ public: (){ << ; if( > 0 ){ ( - 1 ); }} ; protected: private: (){ = ; -= ; return ;} } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 327 OOP.Object.Function.Private.The function is private in the class and cannot be called > {{ public: ; (){ = ; << ; ( + 1 ); } protected: private: (){ = ; *= ; << ;} } (){ = (); .(); }} > Type: debug_output Hardness: 10 // integrated - pre # 328 OOP.Object.Function.Private.The function is private in the class and cannot be called > {{ public: (){ = ; << ( * 2 ); } ; protected: private: (){ = ; %= 2; return ;} } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 329 OOP.Object.Function.Private.The function is private in the class and cannot be called > {{ public: ; (){(); ( + 1); } protected: private: (){ = ; /= 2; << ;} } (){ =; = (); .(); }} > Type: debug_output Hardness: 10 // integrated - post # 330 OOP.Object.Function.Private.The function is private in the class and cannot be called > {{ public: (){<< ( ) * ( + 1 ); } ; protected: private: (){ = ; ++; return ;} } (){ = (); =; << .(); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // OOP.Object.Function.The function is not a static member of the class, and cannot be accessed with respect to the class # 350 OOP.Object.Function.The function is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){if( >= 0){ =;} else { = * -1;} } protected: (){ = ; << ;} private: ; } (){ = (); .(); }} > Type: debug_output Hardness: 10 # 351 OOP.Object.Function.The function is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){if( >= ){ = / ;} else { = % ;} << ; } protected: (){ = ; return ;} private: ; } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 352 OOP.Object.Function.The function is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){ = ; if( % 2 != 0 ){ /= 2 + 1;} << ;} protected: (){ = ; << ;} private: ; } (){ = (); .(); }} > Type: debug_output Hardness: 10 # 353 OOP.Object.Function.The function is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){ = ; if( % 2 != 0 ){++;} << ;} protected: (){ = ; return ;} private: ; } (){ = (); << .(); }} > Type: debug_output Hardness: 10 // integrated - pre # 354 OOP.Object.Function.The function is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){ = ; += ; -= ; << ; << ;} protected: (){ = ; << ;} private: ; } (){ =; = (); .(); }} > Type: debug_output Hardness: 10 // integrated - post # 355 OOP.Object.Function.The function is not a static member of the class and cannot be accessed with respect to the class > {{ public: (){ = ; << * ; << / ; << - ;} protected: (){ = ; return ;} private: ; } (){ = (); =; << .(); }} > Type: debug_output Hardness: 10 // ================================================================================= // // All public member functions // --------------------------------------------------------------------------------- // // Execution of constructor code (B) wrt object - 400 // Object.Constructor.By Client // This learning objective is only about constructor code being executed, not data members being initialized # 400 OOP.Object.Constructor.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ = ;<< ;} protected: ; private: } (){ = (); = ; << ; }} > Type: debug_output Hardness: 10 # 401 OOP.Object.Constructor.By Client ? Object.Variable.Public.By Object Function > [] {{ public: (){; >> ; << ;} protected: private: ; } (){ = ; = (); << ; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // Integrated problem - pre # 402 OOP.Object.Constructor.By Client ? Object.Variable.Public.By Object Function > [] {{ public: (){ = ; << ; >> ; << ;} protected: ; private: } (){ = ; = (); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // Integrated problem - post # 403 OOP.Object.Constructor.By Client ? Object.Variable.Public.By Object Function > [,] {{ public: (){; >> ; << ; = ; << ;} protected: private: ; } (){ = ; = (); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 404 OOP.Object.Constructor.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ = ;<< ;} protected: private: ; } (){ = (); = ; = (); << ; }} > Type: debug_output Hardness: 15 # 405 OOP.Object.Constructor.By Client ? Object.Variable.Public.By Object Function > [] {{ public: (){; >> ; << ;} protected: ; private: } (){ = ; = (); << ; = (); }} > Input: "\n\n\n" > Type: debug_output Hardness: 15 // --------------------------------------------------------------------------------- // // Execution of constructor with one or more parameters - 425 // Object.Initialization.Basic object // Will not give credit to Constructor.By Client because // here, a data member will be updated. // In Constructor.By Client, it is only about constructor code being executed, not data members being initialized # 425 OOP.Object.Initialization.Basic object ? Object.{Constructor.By Client,Variable.Public.By Object Function} > {{ public: (){ = ;<< ;<< + 1;} ; protected: private: } (){ = ( ); }} > Type: debug_output Hardness: 10 # 426 OOP.Object.Initialization.Basic object ? Object.{Constructor.By Client,Variable.Public.By Object Function} > {{ public: (){ = ;<< ;} ; protected: private: } (){ = ; << ; = ( ); }} > Type: debug_output Hardness: 10 # 427 OOP.Object.Initialization.Basic object ? Object.{Constructor.By Client,Variable.Public.By Object Function} > {{ public: (){ = ;<< ;} ; protected: private: } (){ ; >> ; = ( ); << ; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // integrated - pre # 428 OOP.Object.Initialization.Basic object ? Object.{Constructor.By Client,Variable.Public.By Object Function} > {{ public: (, ){ = ;<< ; = ; << ;} ; ; protected: private: } (){ = ( , ); }} > Type: debug_output Hardness: 15 // integrated - post # 429 OOP.Object.Initialization.Basic object ? Object.{Constructor.By Client,Variable.Public.By Object Function} > {{ public: (, ){ = ;<< ; = ; << ;} ; ; protected: private: } (){ = ; = ; = ( , ); }} > Type: debug_output Hardness: 15 # 430 OOP.Object.Initialization.Basic object ? Object.{Constructor.By Client,Variable.Public.By Object Function} > {{ public: (, ){ = ;<< ; = ; << ;} ; ; protected: private: } (){ ; >> ; ; >> ; = ( , ); }} > Input: "\n\n\n" > Type: debug_output Hardness: 15 // --------------------------------------------------------------------------------- // // Execution of constructor with incorrect number of parameters - 450 // Object.Constructor.Number of actual parameters in the call not equal to the number of formal parameters in the definition // 0-1, 1-0, 0-2, 2-0, 1-2, 2-1 # 450 OOP.Object.Constructor.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (){ = ;<< ;} ; protected: private: } (){ = ( ); }} > Type: debug_output Hardness: 10 # 451 OOP.Object.Constructor.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: ( ){ = ; << ; << ;} ; protected: private: } (){ = (); }} > Type: debug_output Hardness: 10 # 452 OOP.Object.Constructor.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (){>> ; while( % 2 == 0 ){>> ;} << ;} ; protected: private: } (){ ; >> ; ; >> ; = ( , ); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 453 OOP.Object.Constructor.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (, ){if( > ){ = % ;} else { = % ;} << ;} ; protected: private: } (){ = ; = (); << ; }} > Type: debug_output Hardness: 10 // integrated - pre # 454 OOP.Object.Constructor.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (){if( % 2 == 0 ){ = * 10;} else { = + 10;} << ;} ; protected: private: } (){ ; >> ; ; >> ; = ( , ); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // integrated - post # 455 OOP.Object.Constructor.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (, ){if( < ){ = ;} else { = ;} << ;} ; protected: private: } (){ = ; = ( ); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of constructor with incorrect data types for parameters - 475 // Object.Constructor.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition // Only using examples with real actual and integer formal parameter, and not vice versa # 475 OOP.Object.Constructor.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (){ = * 10;<< ;} ; protected: private: } (){ = ; = ( ); }} > Type: debug_output Hardness: 10 // integrated - pre # 476 OOP.Object.Constructor.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (, ){ = / + % ; << ;} ; protected: private: } (){ = ; = ; = ( , ); }} > Type: debug_output Hardness: 10 // integrated - post # 477 OOP.Object.Constructor.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (, ){ = ( + ) * ( - ); << ;} ; protected: private: } (){ = ; << ; = ; << ; = ( , ); }} > Type: debug_output Hardness: 10 # 478 OOP.Object.Constructor.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (, ){ = * ; << ; << ;} ; protected: private: } (){ = ; ; = * 2; = ( , ); }} > Type: debug_output Hardness: 10 # 479 OOP.Object.Constructor.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (, ){ = % 2; << ; << ;} ; protected: private: } (){ = ; << ; = ( , ); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of selectors (B) wrt object - 500 // Object.Selector.By Client # 500 OOP.Object.Selector.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ = ; return ;} ; protected: private: } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 501 OOP.Object.Selector.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ = ; return ;} ; protected: private: } (){ ; = (); = .(); << ; }} > Type: debug_output Hardness: 10 # 502 OOP.Object.Selector.By Client ? Object.Variable.Public.By Object Function > {{ public: (){>> ; return ;} ; protected: private: } (){ = (); << .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 503 OOP.Object.Selector.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ = ; << ; return ;} ; protected: private: } (){ ; = (); = .(); << ; }} > Type: debug_output Hardness: 15 # 504 OOP.Object.Selector.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ = ; << ; return ;} ; protected: private: } (){ = (); << .(); }} > Type: debug_output Hardness: 15 // integrated - pre # 505 OOP.Object.Selector.By Client ? Object.Variable.Public.By Object Function > {{ public: (){>> ; return ;} ; protected: private: } (){ ; = (); = .(); << ; << .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 15 // integrated - post # 506 OOP.Object.Selector.By Client ? Object.Variable.Public.By Object Function > {{ public: (){>> ; return ;} ; protected: private: } (){ = (); = (); << .(); << .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 15 // --------------------------------------------------------------------------------- // // Value returned by the selector is ignored by the caller - 525 // Object.Selector.Value returned by the function is ignored by the caller # 525 OOP.Object.Selector.Value returned by the function is ignored by the caller > {{ public: (){ = ; return ;} ; protected: private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 # 526 OOP.Object.Selector.Value returned by the function is ignored by the caller > {{ public: (){ = ; return ;} ; protected: private: } (){ = (); .(); = 0; << ; }} > Type: debug_output Hardness: 10 # 527 OOP.Object.Selector.Value returned by the function is ignored by the caller > {{ public: (){>> ; return ;} ; protected: private: } (){ = (); .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 528 OOP.Object.Selector.Value returned by the function is ignored by the caller > {{ public: (){ = ; << ; = + ; return ;} ; protected: private: } (){ = (); = ; .(); << ; }} > Type: debug_output Hardness: 15 # 529 OOP.Object.Selector.Value returned by the function is ignored by the caller > {{ public: (){ = ; << ; = - ; return ;} ; protected: private: } (){ = (); .(); }} > Type: debug_output Hardness: 15 # 530 OOP.Object.Selector.Value returned by the function is ignored by the caller > {{ public: (){ = ;if( < 5.0 ){ << ;} else { << - 5.0;} return * 2;} ; protected: private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Selector is called before data member is initialized - 550 // Object.Selector.Referencing variable before initializing its value // Java compiler initializes value to zero anyway - do not use for Java # 550 OOP.Object.Selector.Referencing variable before initializing its value ? Object.Variable.Public.By Object Function > {{ public: (){<< ;} ; protected: private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 # 551 OOP.Object.Selector.Referencing variable before initializing its value ? Object.Variable.Public.By Object Function > {{ public: (){<< ; = ; return ; } ; protected: private: } (){ = (); << .(); }} > Type: debug_output Hardness: 10 # 552 OOP.Object.Selector.Referencing variable before initializing its value ? Object.Variable.Public.By Object Function > {{ public: (){<< ; >> ; return ;} ; protected: private: } (){ = (); << .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // integrated - pre # 553 OOP.Object.Selector.Referencing variable before initializing its value ? Object.Variable.Public.By Object Function > {{ public: (){<< ; = ; return ; } ; protected: private: } (){ = (); ; = .(); << ; }} > Type: debug_output Hardness: 10 // integrated - post # 554 OOP.Object.Selector.Referencing variable before initializing its value ? Object.Variable.Public.By Object Function > {{ public: (){<< ; >> ; return ;} ; protected: private: } (){ ; = (); = .(); << ; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of mutators (B) wrt object - 600 // Object.Mutator.By Client # 600 OOP.Object.Mutator.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ = ; << ;} ; protected: private: } (){ = (); .( ); }} > Type: debug_output Hardness: 10 # 601 OOP.Object.Mutator.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ = ; << ;} ; protected: private: } (){ = ; = (); << ; .( ); }} > Type: debug_output Hardness: 10 # 602 OOP.Object.Mutator.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ = ; << ;} ; protected: private: } (){ ; = (); >> ; .( ); << ; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // integrated - pre # 603 OOP.Object.Mutator.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ << ; if( > ) { = ; } else{ = 0; } << ; } ; protected: private: } (){ = (); .( ); }} > Type: debug_output Hardness: 10 // integrated - post # 604 OOP.Object.Mutator.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ = ; << ; if( < ){ = + 1;} else { = - 1;} << ;} ; protected: private: } (){ = ; = (); .( ); << ; }} > Type: debug_output Hardness: 10 # 605 OOP.Object.Mutator.By Client ? Object.Variable.Public.By Object Function > {{ public: (){ if( < 0 ) { = ; } else { >> ; } << ;} ; protected: private: } (){ ; = (); >> ; .( ); << ; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Value returned by the mutator is ignored by the caller - 625 // Object.Mutator.Value returned by the function is ignored by the caller # 625 OOP.Object.Mutator.Value returned by the function is ignored by the caller > {{ public: (){if( >= 0){ = ; << ; return true;} else { = * -1; << ;return false;}} ; protected: private: } (){ = ; = (); .( ); }} > Type: debug_output Hardness: 10 # 626 OOP.Object.Mutator.Value returned by the function is ignored by the caller > {{ public: (){ if( > ) { = ; << ; return true; } else{ = 0; << ; return false;} } ; protected: private: } (){ = (); .( ); }} > Type: debug_output Hardness: 10 # 627 OOP.Object.Mutator.Value returned by the function is ignored by the caller > {{ public: (){ = ; << ; if( % 2 == 0 ){ return true; } else { return false; } } ; protected: private: } (){ = ; = (); .( ); << ; }} > Type: debug_output Hardness: 10 # 628 OOP.Object.Mutator.Value returned by the function is ignored by the caller > {{ public: (){ if( < 0 ) { = ; << ; return true; } else { >> ; << ; return false; } } ; protected: private: } (){ ; = (); >> ; .( ); << ; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 629 OOP.Object.Mutator.Value returned by the function is ignored by the caller > {{ public: (){ >> ; if( < ) { = ; << ; return true; } else { << ; return false; } } ; protected: private: } (){ = (); ; >> ; .( ); << ; }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 630 OOP.Object.Mutator.Value returned by the function is ignored by the caller > {{ public: (, ){ if( > ) { = ; << ; return true; } else { = ; << ; return false; } } ; protected: private: } (){ = (); .( , ); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Mutator is called with incorrect number of parameters - 650 // Object.Mutator.Number of actual parameters in the call not equal to the number of formal parameters in the definition // 0-1, 0-2, 2-1, 1-2 # 650 OOP.Object.Mutator.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (){ = ; << ;} ; protected: private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 # 651 OOP.Object.Mutator.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (, ){if( > ) { = / ;} else { = % ;} << ;} ; protected: private: } (){ = (); .(); }} > Type: debug_output Hardness: 10 # 652 OOP.Object.Mutator.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (){ = ; if( < 0 ) { = * -1;} << ;} ; protected: private: } (){ = ; = (); .( , ); }} > Type: debug_output Hardness: 10 # 653 OOP.Object.Mutator.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (, ){if( > ) { = - ;} else { = - ;} << ;} ; protected: private: } (){ = ; = (); .( ); }} > Type: debug_output Hardness: 10 # 654 OOP.Object.Mutator.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (){ >> ; while( < ){ >> ; } << ;} ; protected: private: } (){ ; ; = (); >> ; >> ; .( , ); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 655 OOP.Object.Mutator.Number of actual parameters in the call not equal to the number of formal parameters in the definition > {{ public: (, ){>> ; if( < || > ) { = ( - ) / 2;} << ;} ; protected: private: } (){ ; = (); >> ; .( ); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Mutator is called with incorrect data type for parameters - 675 // Object.Mutator.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition # 675 OOP.Object.Mutator.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (){ = ; << ;} ; protected: private: } (){ = ; = (); .( ); }} > Type: debug_output Hardness: 10 # 676 OOP.Object.Mutator.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (, ){ = ; if( < ) { = * 2;} << ;} ; protected: private: } (){ = ; = ; = (); .( , ); }} > Type: debug_output Hardness: 10 # 677 OOP.Object.Mutator.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (, ){ = - ; if( < 0 ) { = * -1;} << ;} ; protected: private: } (){ = ; = ; = (); .( , ); }} > Type: debug_output Hardness: 10 # 678 OOP.Object.Mutator.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (, ){ >> ; while( > && < ){ >> ; } << ;} ; protected: private: } (){ ; >> ; = ; = (); .( , ); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 679 OOP.Object.Mutator.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (, ){; >> ; = 0; while( == || == ){ ++; >> ; } << ;} ; protected: private: } (){ ; = ; = (); >> ; .( , ); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 # 680 OOP.Object.Mutator.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition > {{ public: (, ){ = ; << ; if( > 0 ) { *= ;} << ;} ; protected: private: } (){ = ; = ; = (); .( , ); }} > Type: debug_output Hardness: 10 // Could have additional templates: 2 real actual parameters, only one real formal parameter // --------------------------------------------------------------------------------- // // Execution of destructor code (B) wrt object - 700 // Object.Destructor.By Client # 700 OOP.Object.Destructor.By Client > {{ public: (, ){ = ; << ; if( > 0 ) { *= ;} << ;} (){<< ;} protected: ; private: } (){ = (); = ; << ; }} > Type: debug_output Languages: C++ C# Hardness: 10 // integrated - pre # 701 OOP.Object.Destructor.By Client > {{ public: (){ >> ; while( < ){ >> ; } << ;} (){ = ;<< ;} protected: private: ; } (){ = ; = (); << ; }} > Type: debug_output Languages: C++ C# Hardness: 10 # 702 OOP.Object.Destructor.By Client > {{ public: (){ if( < 0 ) { = ; << ; return true; } else { >> ; << ; return false; } } (){ = ;<< ;} protected: ; private: } (){ ; >> ; = (); << ; }} > Input: "\n\n" > Type: debug_output Languages: C++ C# Hardness: 10 // integrated - post # 703 OOP.Object.Destructor.By Client > {{ public: (){ = ; return ;} (){ = ;<< ;} protected: private: ; } (){ = (); = ; << ; }} > Type: debug_output Languages: C++ C# Hardness: 10 # 704 OOP.Object.Destructor.By Client > {{ public: (){ = ; if( < ){ = + 1;} else { = - 1;} << ;} (){ = ;<< ;} protected: ; private: } (){ ; = (); >> ; << ; }} > Input: "\n\n" > Type: debug_output Languages: C++ C# Hardness: 10 # 705 OOP.Object.Destructor.By Client > {{ public: (){; >> ; if( > ){ << ; } else {<< + 1; }} (){ = ;<< ;} protected: private: ; } (){ = (); = ; = (); << ; }} > Input: "\n\n" > Type: debug_output Languages: C++ C# Hardness: 20 // --------------------------------------------------------------------------------- // ON SECOND THOUGHTS, THESE PROBLEMS MAKE NO SENSE IN EITHER C++ OR JAVA // // Assigning an object to class instead of another object - 800 // Object.Assignment.Aggregate.Assigning to class // Object.Assignment.Aggregate.Object cannot be assigned to a class // C++: // student jane( 2345 ); // student = jane; // or // student ( 2345 ); // NO, Ignore // Java: // Student jane = new Student( 2345 ); // Student = jane; // or // Student = new Student( 2345 ); // NO, Ignore // # 800 // OOP.Object.Assignment.Aggregate.Object cannot be assigned to a class // > // {{ // public: // (){ = ;<< ;} // ; // protected: // private: // } // (){ // = (); // = ; // << ; // }} // > // Type: debug_output // Languages: C++ // Hardness: 10 // // # 801 // OOP.Object.Assignment.Aggregate.Object cannot be assigned to a class // > // {{ // public: // (){>> ; = * 10;<< ;} // ; // protected: // private: // } // (){ // = (); // = ; // ; >> ; // = * ; // << ; // }} // > // Input: "\n\n" // > // Type: debug_output // Languages: C++ // Hardness: 10 // --------------------------------------------------------------------------------- // // Aggregate assignment from one object to another - 825 // Object.Assignment.Aggregate.Assigning object to variabl // FROM HERE # 825 OOP.Object.Assignment.Aggregate.Assigning object to variable ? Object.{Constructor.By Client,Variable.Public.By Object Function,Selector.By Client} > {{ public: (){>> ;<< ;} (){return ;} ; protected: private: } (){ = (); = (); = ; << .; << .(); }} > Input: "\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Object passed as parameter to a function where it is accessed - 850 // Object.Parameter.Aggregate.Accessed // To show that state of object is preserved through function call: // caller assigns to a public variable, callee prints public variable // caller assigns to a public variable, callee calls selector // caller calls mutator, callee prints public variable // caller calls mutator, callee calls selector # 850 OOP.Object.Parameter.Aggregate.Accessed ? Object.Variable.Public.By Client > {{ public: ; protected: private: } (){ // = (); // . = 2; // << .; // . = 3; // ; << .; // = .; // << ; } (){ = (); . = ; // << .; ( ); }} > Type: debug_output Hardness: 10 # 851 OOP.Object.Parameter.Aggregate.Accessed ? Object.Variable.Public.By Client > {{ public: ; protected: private: } (){ << .; } (){ = (); >> .; ( ); }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 855 OOP.Object.Parameter.Aggregate.Accessed ? Object.{Variable.Public.{By Client,By Object Function},Selector.By Client} > {{ public: ; (){return ;} protected: private: } (){ = .(); << ; } (){ = (); . = ; ( ); }} > Type: debug_output Hardness: 20 # 856 OOP.Object.Parameter.Aggregate.Accessed ? Object.{Variable.Public.{By Client,By Object Function},Selector.By Client} > {{ public: (){return ;} ; protected: private: } (){ ; = .(); << ; } (){ = (); >> .; ( ); }} > Input: "\n\n" > Type: debug_output Hardness: 20 # 860 OOP.Object.Parameter.Aggregate.Accessed ? Object.{Variable.Public.{By Client,By Object Function},Mutator.By Client} > {{ public: ; (){=;} protected: private: } (){ ; = .; << ; } (){ = (); .(); ( ); }} > Type: debug_output Hardness: 20 # 861 OOP.Object.Parameter.Aggregate.Accessed ? Object.{Variable.Public.{By Client,By Object Function},Mutator.By Client} > {{ public: (){=;} ; protected: private: } (){ << .; } (){ ; = (); >> ; .(); ( ); }} > Input: "\n\n" > Type: debug_output Hardness: 20 # 865 OOP.Object.Parameter.Aggregate.Accessed ? Object.{Variable.Public.{By Client,By Object Function},Selector.By Client,Mutator.By Client} > {{ public: ; (){return ;} (){=;} protected: private: } (){ << .(); } (){ = (); .(); ( ); }} > Type: debug_output Hardness: 30 // integrated - pre, post - deliberately the most complex, in case students satisfy selector/mutator learnobj # 866 OOP.Object.Parameter.Aggregate.Accessed ? Object.{Variable.Public.{By Client,By Object Function},Selector.By Client,Mutator.By Client} > {{ public: (){=;} (){return ;} ; protected: private: } (){ ; = .(); << ; } (){ ; = (); >> ; .(); ( ); }} > Input: "\n\n" > Type: debug_output Hardness: 30 // --------------------------------------------------------------------------------- // // Object passed as parameter to a function where it is modified - 875 // Object.Parameter.Aggregate.Modified // To show that state of object is (not) modified by callee (C++)/Java/C#: // callee assigns to a public variable, caller prints public variable // callee assigns to a public variable, caller calls selector // callee calls mutator, caller prints public variable // callee calls mutator, caller calls selector # 875 OOP.Object.Parameter.Aggregate.Modified ? Object.Variable.Public.By Client > {{ public: ; protected: private: } (){ . = ;; << .; } (){ = (); . = ; ( ); << .; }} > Type: debug_output Hardness: 10 # 876 OOP.Object.Parameter.Aggregate.Modified ? Object.Variable.Public.By Client > {{ public: ; protected: private: } (){ >> .; << .; } (){ = (); >> .; ( ); << .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 880 OOP.Object.Parameter.Aggregate.Modified ? Object.{Variable.Public.{By Client,By Object Function},Selector.By Client} > {{ public: ; (){return ;} protected: private: } (){ ; . = ; = .(); << ; } (){ = (); . = ; ( ); = .(); << ; }} > Type: debug_output Hardness: 20 # 881 OOP.Object.Parameter.Aggregate.Modified ? Object.{Variable.Public.{By Client,By Object Function},Selector.By Client} > {{ public: (){return ;} ; protected: private: } (){ ; >> .; = .(); << ; } (){ ; = (); >> .; ( ); = .(); << ; }} > Input: "\n\n" > Type: debug_output Hardness: 20 # 885 OOP.Object.Parameter.Aggregate.Modified ? Object.{Variable.Public.{By Client,By Object Function},Mutator.By Client} > {{ public: ; (){=;} protected: private: } (){ ; .(); = .; << ; } (){ = (); .(); ( ); << .; }} > Type: debug_output Hardness: 20 # 886 OOP.Object.Parameter.Aggregate.Modified ? Object.{Variable.Public.{By Client,By Object Function},Mutator.By Client} > {{ public: (){=;} ; protected: private: } (){ ; >> ; .(); << .; } (){ ; = (); >> ; .(); ( ); = .; << ; }} > Input: "\n\n" > Type: debug_output Hardness: 20 // integrated - pre, post - deliberately the most complex, in case students satisfy selector/mutator learnobj # 890 OOP.Object.Parameter.Aggregate.Modified ? Object.{Variable.Public.{By Client,By Object Function},Selector.By Client,Mutator.By Client} > {{ public: ; (){return ;} (){=;} protected: private: } (){ ; .(); = .(); << ; } (){ = (); .(); ( ); << .(); }} > Type: debug_output Hardness: 30 # 891 OOP.Object.Parameter.Aggregate.Modified ? Object.{Variable.Public.{By Client,By Object Function},Selector.By Client,Mutator.By Client} > {{ public: (){=;} (){return ;} ; protected: private: } (){ ; >> ; .(); << .(); } (){ ; = (); >> ; .(); ( ); = .(); << ; }} > Input: "\n\n" > Type: debug_output Hardness: 30 // ================================================================================= // // STATIC VARIABLE AND FUNCTION IN A CLASS // --------------------------------------------------------------------------------- // // Accessing public (D) data member by static member function - 300 // // Accessing protected (D) data member by static member function // // Accessing private (D) data member by static member function // Object.Variable.Public.By Class Function // Object.Variable.Protected.By Class Function // Object.Variable.Private.By Class Function // Object.Variable.Public.Class (static) function does not have access to public data member of the object // Object.Variable.Protected.Class (static) function does not have access to protected data member of the object // Object.Variable.Private.Class (static) function does not have access to private data member of the object # 300 OOP.Object.Variable.The variable is not a static member of the class and cannot be accessed in a static function > {{ public: static (){ = ;} ; protected: private: } (){ = .(); .(); }} > Type: debug_output Hardness: 10 # 301 OOP.Object.Variable.The variable is not a static member of the class and cannot be accessed in a static function > {{ public: static (){;>> ;>> ;<< - 10;} protected: ; private: } (){ = (); .(); }} > Input: "\n\n" > Type: debug_output Hardness: 10 # 302 OOP.Object.Variable.The variable is not a static member of the class and cannot be accessed in a static function > {{ public: static (){; = ; = ;} protected: private: ; } (){ = (); .(); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static public (B) data member by client - 1000 // Class.Variable.Public.Wrt Class # 1000 OOP.Class.Variable.Public.Wrt Class > {{ public: static ; (){>> ;<< ;} protected: private: ; } (){ . = ; << .; }} > Input: "\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static public (B) data member by client - 1025 // Class.Variable.Public.Wrt Object # 1025 OOP.Class.Variable.Public.Wrt Object > {{ public: (){>> ;<< ;} static ; protected: private: ; } (){ = (); .(); >> .; }} > Input: "\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static protected (D) data member by client - 1050 // Class.Variable.Protected.By Client # 1050 OOP.Class.Variable.Protected.By Client > {{ public: (){ = ;<< ;} protected: static ; private: ; } (){ = (); . = ; .(); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static private (D) data member by client - 1075 // Class.Variable.Private.By Client # 1075 OOP.Class.Variable.Private.By Client > {{ public: (){>> ;<< + 1;>> ;<< - 1;} protected: private: ; static ; } (){ = (); >> .; .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static public (B) data member by static member function - 1100 // Class.Variable.Public.By Class Function # 1100 OOP.Class.Variable.Public.By Class Function ? Class.Function.Public.Wrt Class > {{ public: static (){ = ;return ;} static ; protected: private: } (){ << .(); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static protected (B) data member by static member function - 1125 // Class.Variable.Protected.By Class Function # 1125 OOP.Class.Variable.Protected.By Class Function ? Class.Function.Public.Wrt Class > {{ public: static (){>> ;<< ;>> ;return ;} protected: static ; private: } (){ = (); << .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static private (B) data member by static member function - 1150 // Class.Variable.Private.By Class Function # 1150 OOP.Class.Variable.Private.By Class Function ? Class.Function.Public.Wrt Class > {{ public: static (){>> ; = * 10;<< ;} protected: private: static ; } (){ = (); .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static public (D) data member by dynamic member function - 1200 // Class.Variable.Public.By Object Function # 1200 OOP.Class.Variable.Public.By Object Function > {{ public: (){ = ; = * 10;return ;} static ; protected: private: } (){ = (); << .(); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static protected (D) data member by dynamic member function - 1225 // Class.Variable.Protected.By Object Function # 1225 OOP.Class.Variable.Protected.By Object Function > {{ public: (){>> ; = + 10;return ;} protected: static ; private: } (){ = (); << .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static private (D) data member by dynamic member function - 1250 // Class.Variable.Private.By Object Function # 1250 OOP.Class.Variable.Private.By Object Function > {{ public: (){>> ; = + 1;return ;} protected: private: static ; } (){ = (); << .(); << .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static public (B) member function wrt class name by client - 1300 // Class.Function.Public.Wrt Class # 1300 OOP.Class.Function.Public.Wrt Class > {{ public: // static (){ = ; = + 10;<< ;} // static (){ = ; = * 10;<< ;.();} static (){ = ; = * 10;<< ;} (){ = ;} protected: private: ; } (){ = (); .(); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static public (D) member function wrt object by client - 1325 // Class.Function.Public.Wrt Object # 1325 OOP.Class.Function.Public.Wrt Object > {{ public: static (){ = ; = + 10;<< ;} (){ = ; = - 10; << ;} protected: private: ; } (){ = (); .( ); }} > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static protected (D) member function by client - 1350 // Class.Function.Protected.By Client # 1350 OOP.Class.Function.Protected.By Client > {{ public: (){ = ;} protected: static (){;>> ; = * 10;<< ;>> ; = + 10;<< ;} private: ; } (){ = (); .(); }} > Input: "\n\n\n" > Type: debug_output Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing static private (D) member function by client - 1375 // Class.Function.Private.By Client # 1375 OOP.Class.Function.Private.By Client > {{ public: (){ = ;} protected: ; private: static (){;>> ; = + ;<< ;>> ; = - ;<< ;} } (){ = (); .( ); }} > Input: "\n\n" > Type: debug_output Hardness: 10 // ================================================================================= // REVISIT DIFFEREING SYNTAXES FOR C++ AND JAVA//C# FROM HERE-ONWARDS AND INTRODUCE LANGUAGES TAG AS APPROPRIATE // ================================================================================= // // COMPOSITION OF CLASSES // // Called in Composer function, which is in turn called by client // --------------------------------------------------------------------------------- // // Accessing public (B) data member by composing class - 2000 // Object.Variable.Public.By Composer // ***Technically synonymous with*** Object.Variable.Public.By Client # 2000 OOP.Object.Variable.Public.By Composer ? OOP.Object.Variable.Public.By Object Function > {{ public: ; protected: (){=;return ;} private: } { public: (){ = ();} (){>> .;.++;<< .;} ; protected: private: } (){ = (); .(); }} > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (D) data member by composing class - 2025 // Object.Variable.Protected.By Composer // ***Technically synonymous with*** Object.Variable.Protected.By Client # 2025 OOP.Object.Variable.Protected.By Composer ? OOP.Object.Variable.Protected.By Object Function > {{ public: (){=;return ;} protected: ; private: } { public: (){ = ;.=;<< ;} (){ = ();} protected: ; private: } (){ = (); .(); }} > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) data member by composing class - 2050 // Object.Variable.Private.By Composer // ***Technically synonymous with*** Object.Variable.Private.By Client # 2050 OOP.Object.Variable.Private.By Composer ? OOP.Object.Variable.Private.By Object Function > {{ public: (){=;return ;} protected: private: ; } { public: (){. = ;<< ;} (){ = ();} protected: private: ; } (){ = ; = (); .(); }} > Type: debug_output Languages: C++ Hardness: 10 // // Called in Composer function, which is in turn called by client // --------------------------------------------------------------------------------- // // Accessing protected (D) member function by composing class - 2100 // Object.Function.Protected.By Composer // ***Technically synonymous with*** Object.Function.Protected.By Client # 2100 OOP.Object.Function.Protected.By Composer ? OOP.Object.Variable.Protected.By Object Function > {{ public: protected: (){>> ; = + 10;<< ;} ; private: } { public: (){;.(); >> ; << ;} (){ = ();} protected: ; private: } (){ = (); .(); }} > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) member function by composing class - 2125 // Object.Function.Private.By Composer // ***Technically synonymous with*** Object.Function.Private.By Client # 2125 OOP.Object.Function.Private.By Composer ? OOP.Object.Variable.Private.By Object Function > {{ public: protected: private: (){ = ;<< ;} ; } { public: (){.(); << ;} (){ = ();} protected: private: ; } (){ = ; = (); .( ); }} > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of constructor code (B) by composing class constructor - 2200 // Object.Constructor.By Composer # 2200 OOP.Object.Constructor.By Composer ? OOP.Object.Variable.Private.By Object Function > {{ public: (){ = ;<< ;} protected: private: } { public: (){ = (); = ;<< ;} protected: private: ; } (){ = ; = (); << ; }} > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Calling constructor with arguments, some of which are used to initialize composed object - 2225 // Object.Initialization.Composed object # 2225 OOP.Object.Initialization.Composed object ? OOP.Object.{Initialization.Basic object,Variable.Private.By Object Function} > {{ public: (){ = ;<< ;} protected: private: ; } { public: (,){=(); = ;<< ;} protected: private: ; ; } (){ = ( , ); }} > Type: debug_output Languages: C++ Hardness: 10 # 2226 OOP.Object.Initialization.Composed object ? OOP.Object.{Initialization.Basic object,Variable.Protected.By Object Function} > {{ public: (){ = ;<< ;} protected: ; private: } { public: (,){ = ;=();<< ;} protected: ; ; private: } (){ ; >> ; ; >> ; = ( , ); }} > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of selectors (B) by composing class function - 2250 // Object.Selector.By Composer # 2250 OOP.Object.Selector.By Composer ? OOP.Object.Variable.Public.By Object Function > {{ public: (){ = ;<< ; = + 1; return ;} ; protected: private: } { public: (){ = ();} (){ = .();<< ;} ; protected: private: } (){ = (); .(); }} > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of mutators (B) by composing class function - 2275 // Object.Mutator.By Composer # 2275 OOP.Object.Mutator.By Composer ? OOP.Object.Variable.Protected.By Object Function > {{ public: ( ){ = ;<< ;} protected: ; private: } { public: (){ = ();} ( ){.( ); = + 10;<< ;} protected: ; private: } (){ = (); = ; .( ); }} > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of destructor code (B) by composing class destructor - 2300 // Object.Destructor.By Composer # 2300 OOP.Object.Destructor.By Composer ? OOP.Object.Variable.Protected.By Object Function > {{ public: (){ = ;<< ;} protected: private: } { public: (){ = ();} (){ = ;<< ;} protected: ; private: } (){ = ; { = (); = - 10; } = + 1; }} > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing public (D) data member wrt composing object by client - 2400 // Object.Variable.Public.Wrt Composer # 2400 OOP.Object.Variable.Public.Wrt Composer ? OOP.Object.Variable.Public.By Client > {{ public: ( ){ = % 2;<< ;} ; protected: private: } { public: (){ = ();} (){ = ;<< / 2;return ;} ; protected: private: ; } (){ = (); .. = ; << ..; }} > Type: debug_output Languages: C++ Hardness: 10 # 2401 OOP.Object.Variable.Public.Wrt Composer > {{ public: (){>> ;<< ;return ;} ; protected: private: } { public: (){ = ();} (){ = .(); = * ;<< ;} ; protected: private: ; } (){ = (); . = ; << .(); }} > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (D) data member wrt composing object by client - 2425 // Object.Variable.Protected.Wrt Composer # 2425 OOP.Object.Variable.Protected.Wrt Composer > {{ public: (){ = ; = * 2;return ;} protected: ; private: } { public: ( ){ = / 2; = * 10;<< ;} (){ = ();} ; protected: private: ; } (){ = (); = ; .. = ; << ; }} > Type: debug_output Languages: C++ Hardness: 10 # 2426 OOP.Object.Variable.Protected.Wrt Composer > {{ public: (){>> ; = * 2;return ;} protected: ; private: } { public: ( ){<< ; << .(); << + .();} (){ = ();} ; protected: private: } (){ = (); >> .; }} > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) data member wrt composing object by client - 2450 // Object.Variable.Private.Wrt Composer # 2450 OOP.Object.Variable.Private.Wrt Composer > {{ public: (){ = ;<< ;return ;} protected: private: ; } { public: (){ = .(); = * 10;<< ;} (){ = ();} ; protected: private: } (){ ; = (); >> ..; >> ; << ; }} > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 # 2451 OOP.Object.Variable.Private.Wrt Composer > {{ public: (){>> ; = * 10;return ;} protected: private: ; } { public: (){<< .();<< .();} (){ = ();} ; protected: private: } (){ = (); >> .; .(); }} > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing public (D) member function wrt composing object by client - 2500 // Object.Function.Public.Wrt Composer # 2500 OOP.Object.Function.Public.Wrt Composer ? OOP.Object.Variable.Public.By Client > {{ public: (){ = ; << ; << + 1;} protected: private: } { public: (){ = ();} (){ = ;<< ;<< - 1;} ; protected: private: ; } (){ = (); ..(); }} > Type: debug_output Languages: C++ Hardness: 10 # 2501 OOP.Object.Function.Public.Wrt Composer > {{ public: (){; >> ;<< ;<< * 10;} protected: private: } { public: (){ = ();} (){.();.();} ; protected: private: } (){ = (); .(); }} > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (D) member function wrt composing object by client - 2525 // Object.Function.Protected.Wrt Composer # 2525 OOP.Object.Function.Protected.Wrt Composer > {{ public: protected: (){ = ; if( % 2 == 0 ) << ; else << - 1;} private: } { public: (){ = ();} ; protected: (){ = .();if( > 5 ) << - 1;else << + 1;} private: } (){ = (); << ..(); }} > Type: debug_output Languages: C++ Hardness: 10 # 2526 OOP.Object.Function.Protected.Wrt Composer > {{ public: protected: (){ do{ >> ; }while( % 2 == 0 ); << ;} private: ; } { public: (){ = ();} ; protected: (){; do{ >> ; }while( < 10 ); << ;} private: } (){ = (); .(); }} > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) member function wrt composing object by client - 2550 // Object.Function.Private.Wrt Composer // # 2550 OOP.Object.Function.Private.Wrt Composer > {{ public: ; protected: private: ( ){if( >= 0 ) { = ;} else = 0;<< ;} } { public: (){ = ();} ; protected: ( ){ = ; if( <= 5 ){ = * 2;} = ; << ;} private: } (){ = (); ..( ); }} > Type: debug_output Languages: C++ Hardness: 10 # 2551 OOP.Object.Function.Private.Wrt Composer > {{ public: ; protected: private: (){do{ >> ;} while( < 10 ); << ;} } { public: (){ = ();} ; protected: ( ){; do{ >> ;} while( < );return ;} private: } (){ = (); .(); }} > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Object is returned by a function, which is then accessed - 2600 // Object.Returned.By Composer // Calling selector/mutator w.r.t object returned by Composer // This learning objective is about chaining dot operator more than anything else.. # 2600 OOP.Object.Returned.By Composer ? OOP.Object.{Constructor.By Client,Selector.By Client,Variable.Protected.By Object Function} > {{ public: (){ = ;} (){ return ; } protected: ; private: } { public: (){=(); = ;} (){ return ; } protected: ; ; private: } (){ = (); << .().(); }} > Type: debug_output Languages: C++ Hardness: 10 # 2601 OOP.Object.Returned.By Composer ? OOP.Object.{Constructor.By Client,Mutator.By Client,Variable.Private.By Object Function} > {{ public: (){ = ;} (){ = ; << ;} protected: private: ; } { public: (){=(); = ;} (){ return ; } protected: private: ; ; } (){ = (); .().( ); }} > Type: debug_output Languages: C++ Hardness: 10 // ================================================================================= // // PUBLIC INHERITANCE // // --------------------------------------------------------------------------------- // // Called in inheritor function, which is in turn called by client // --------------------------------------------------------------------------------- // // Accessing public (B) data member by inheriting class - 3000 // Object.Variable.Public.By Inheritor # 3000 OOP.Object.Variable.Public.By Inheritor > {{ public: (){=;return ;} ; protected: private: } : public { public: (){=;<< ;} protected: private: } (){ = (); .();} } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (B) data member by inheriting class - 3025 // Object.Variable.Protected.By Inheritor # 3025 OOP.Object.Variable.Protected.By Inheritor > {{ public: (){=;return ;} protected: ; private: } : public { public: (){>> ; = + 1;<< ;} protected: private: } (){ = (); .();} } > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) data member by inheriting class - 3050 // Object.Variable.Private.By Inheritor # 3050 OOP.Object.Variable.Private.By Inheritor > {{ public: (){=;return ;} protected: private: ; } : public { public: (){ = ;<< ; = ;} protected: private: } (){ = (); .();} } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (B) member function by inheriting class - 3100 // Object.Function.Protected.By Inheritor # 3100 OOP.Object.Function.Protected.By Inheritor > {{ public: protected: (){;>> ;<< ;} private: } : public { public: (){<< ;();} protected: private: } (){ = ; = (); .( );} } > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) member function by inheriting class - 3125 // Object.Function.Private.By Inheritor # 3125 OOP.Object.Function.Private.By Inheritor > {{ public: protected: private: (){ = * 2;<< ;} } : public { public: (){ = ;<< ;();} protected: private: } (){ = (); .();} } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing public (B) data member wrt inheriting object by client - 3200 // Object.Variable.Public.Wrt Inheritor # 3200 OOP.Object.Variable.Public.Wrt Inheritor > {{ public: (){;>> ;<< ;return ;} ; protected: private: } : public { public: (){<< ; = + 1;<< ;} protected: private: } (){ = ; = (); . = ; << ;} } > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (D) data member wrt inheriting object by client - 3225 // Object.Variable.Protected.Wrt Inheritor # 3225 OOP.Object.Variable.Protected.Wrt Inheritor > {{ public: (){>> ;<< ;return ;} protected: ; private: } : public { public: (){ = ; = / 10;<< ;} protected: private: } (){ = (); . = ; .();} } > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) data member wrt inheriting object by client - 3250 // Object.Variable.Private.Wrt Inheritor # 3250 OOP.Object.Variable.Private.Wrt Inheritor > {{ public: (){if( > 0) = ; else = 0;} protected: private: ; } : public { public: (){;>> ;return ;} protected: private: } (){ = (); >> .; << .();} } > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing public (B) member function wrt inheriting object by client - 3300 // Object.Function.Public.Wrt Inheritor # 3300 OOP.Object.Function.Public.Wrt Inheritor > {{ public: (){ = ; << ;} protected: private: } : public { public: (){;>> ;return ;} protected: private: } (){ = ; = (); .(); << ;} } > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (D) member function wrt inheriting object by client - 3325 // Object.Function.Protected.Wrt Inheritor # 3325 OOP.Object.Function.Protected.Wrt Inheritor > {{ public: protected: (){;>> ; return ;} private: } : public { public: (){; = () + ();<< ;} protected: private: } (){ = (); << .();} } > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) member function wrt inheriting object by client - 3350 // Object.Function.Private.Wrt Inheritor # 3350 OOP.Object.Function.Private.Wrt Inheritor > {{ public: protected: private: (){<< - 1; << ; << + 1;} } : public { public: (){<< / 2; << % 2;} protected: private: } (){ = (); .( ); .( );} } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of constructor code (B) when inheriting class's constructor calls it - 3400 // Object.Constructor.Inheritor.Coopted # 3400 OOP.Object.Constructor.Inheritor.Coopted ? OOP.Object.Variable.Public.By Object Function > {{ public: (){ = ;<< ;} ; protected: private: } : public { public: (){(); = ;<< ;} ; protected: private: } (){ = (); = ; << ; } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of constructor code (B) when inheriting class's constructor does not call it - 3425 // Object.Constructor.Inheritor.Not Coopted # 3425 OOP.Object.Constructor.Inheritor.Not Coopted ? OOP.Object.Variable.Public.By Object Function > {{ public: (){ = ;<< ;<< - 1;} ; protected: private: } : public { public: (){ = ;<< ;<< + 1;} ; protected: private: } (){ = ; = (); << ; } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Constructor is called with arguments, some of which are passed to base class - 3450 // Object.Initialization.Inherited object # 3450 OOP.Object.Initialization.Inherited object ? OOP.Object.{Initialization.Basic object,Variable.Protected.By Object Function} > {{ public: (){ = ;<< ;} protected: ; private: } : public { public: (, ){(); = ;<< ;} protected: ; private: } (){ = ; = ; = ( , ); } > Type: debug_output Languages: C++ Hardness: 10 # 3451 OOP.Object.Initialization.Inherited object ? OOP.Object.{Initialization.Basic object,Variable.Private.By Object Function} > {{ public: (){ = ; = + 1;<< ;} protected: private: ; } : public { public: (, ){(); = ; = - 1;<< ;} protected: private: ; } (){ ; >> ; ; >> ; = ( , ); } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // ================================================================================= // // In each problem, call the overridden function wrt BOTH base and derived class object // // Execution of selectors (B) by inheriting class // --------------------------------------------------------------------------------- // // Execution of selectors (B) by client wrt inheriting object which overrides it, calls it and behavior is polymorphic - 3500 // Object.Selector.Inheritor.Overridden.Coopted.Polymorphic # 3500 OOP.Object.Selector.Inheritor.Overridden.Coopted.Polymorphic ? OOP.Object.{Variable.Public.By Object Function,Assignment.Aggregate.Assigning derived object to base variable} > {{ public: virtual (){ = ;<< ;return ;} ; protected: private: } : public { public: (){ = .(); = * 10;<< ;return ;} protected: private: } (){ = (); = .(); << ; = (); = .(); << ; } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of selectors (B) by client wrt inheriting object which overrides it, does not call it and behavior is polymorphic - 3525 // Object.Selector.Inheritor.Overridden.Not Coopted.Polymorphic # 3525 OOP.Object.Selector.Inheritor.Overridden.Not Coopted.Polymorphic ? OOP.Object.{Variable.Public.{By Inheritor,By Object Function},Assignment.Aggregate.Assigning derived object to base variable} > {{ public: virtual (){ = ;<< ;return ;} ; protected: private: } : public { public: (){ = ;<< ;return ;} protected: private: } (){ = (); = .(); << ; = (); = .(); << ; } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of selectors (B) by client wrt inheriting object which does not override - 3550 // Object.Selector.Inheritor.Not Overridden # 3550 OOP.Object.Selector.Inheritor.Not Overridden ? OOP.Object.Variable.Public.By Object Function > {{ public: virtual (){ = ;<< ;return ;} ; protected: private: } : public { public: (){ = + ;<< ;return ;} protected: private: } (){ = (); = .(); << ; = (); = .(); << ; } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of selectors (B) by client wrt inheriting object which overrides it, calls it, and behavior is not polymorphic (C++ only) - 3575 // Object.Selector.Inheritor.Overridden.Coopted.NonPolymorphic # 3575 OOP.Object.Selector.Inheritor.Overridden.Coopted.NonPolymorphic ? OOP.Object.{Variable.Public.By Object Function,Assignment.Aggregate.Assigning derived object to base variable} > {{ public: (){>> ;<< ;return ;} ; protected: private: } : public { public: (){ = .();>> ;<< ; return - ;} ; protected: private: } (){ = (); << .(); = (); << .(); } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of selectors (B) by client wrt inheriting object which overrides it, does not call it, and behavior is not polymorphic (C++ only) - 3600 // Object.Selector.Inheritor.Overridden.Not Coopted.NonPolymorphic # 3600 OOP.Object.Selector.Inheritor.Overridden.Not Coopted.NonPolymorphic ? OOP.Object.{Variable.Public.By Object Function,Assignment.Aggregate.Assigning derived object to base variable} > {{ public: (){>> ; if( < ){ = + 1; } << ;return ;} ; protected: private: } : public { public: (){>> ; if( > ){ = - 1; } << ;return ;} ; protected: private: } (){ = (); << .(); = (); << .(); } > Type: debug_output Languages: C++ Hardness: 10 // ================================================================================= // // In each problem, call the overridden function wrt both base and derived class object // // Execution of mutators (B) by inheriting class // --------------------------------------------------------------------------------- // // Execution of mutators (B) by client wrt inheriting object which overrides it, calls it and behavior is polymorphic - 3700 // Object.Mutator.Inheritor.Overridden.Coopted.Polymorphic # 3700 OOP.Object.Mutator.Inheritor.Overridden.Coopted.Polymorphic ? OOP.Object.{Variable.Public.By Object Function,Assignment.Aggregate.Assigning derived object to base variable} > {{ public: virtual (){ = ;<< ;} ; protected: private: } : public { public: (){.(); = * 10; << ;} protected: private: } (){ = (); .( ); = (); .( ); } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of mutators (B) by client wrt inheriting object which overrides it, does not call it and behavior is polymorphic - 3725 // Object.Mutator.Inheritor.Overridden.Not Coopted.Polymorphic # 3725 OOP.Object.Mutator.Inheritor.Overridden.Not Coopted.Polymorphic ? OOP.Object.{Variable.Public.{By Object Function,By Inheritor},Assignment.Aggregate.Assigning derived object to base variable} > {{ public: virtual (){ = + 1;<< ;} ; protected: private: } : public { public: (){ = - 1; << ;} protected: private: } (){ = (); .( ); = (); .( ); } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of mutators (B) by client wrt inheriting object which does not override - 3750 // Object.Mutator.Inheritor.Not Overridden # 3750 OOP.Object.Mutator.Inheritor.Not Overridden ? OOP.Object.Variable.Public.By Object Function > {{ public: virtual (){ = + 10;<< ;} ; protected: private: } : public { public: (,){ = + ; << ;} protected: private: } (){ = (); = ; .( ); = (); = ; .( ); } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of mutators (B) by client wrt inheriting object which overrides it, calls it, and behavior is not polymorphic (C++ only) - 3775 // Object.Mutator.Inheritor.Overridden.Coopted.NonPolymorphic # 3775 OOP.Object.Mutator.Inheritor.Overridden.Coopted.NonPolymorphic ? OOP.Object.{Variable.Public.By Object Function,Assignment.Aggregate.Assigning derived object to base variable} > {{ public: (){ = * 10; = ;<< ;} ; protected: private: } : public { public: (){ = + 10;.();<< ;} protected: private: } (){ ; = (); >> ; .( ); = (); >> ; .( ); } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of mutators (B) by client wrt inheriting object which overrides it, does not call it, and behavior is not polymorphic (C++ only) - 3800 // Object.Mutator.Inheritor.Overridden.Not Coopted.NonPolymorphic # 3800 OOP.Object.Mutator.Inheritor.Overridden.Not Coopted.NonPolymorphic ? OOP.Object.{Variable.Public.By Object Function,Assignment.Aggregate.Assigning derived object to base variable} > {{ public: (){ = + 1;<< ;} ; protected: private: } : public { public: (){<< ; = - 1; << ;} protected: private: } (){ ; >> ; = (); .( ); = (); .( ); } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Execution of destructor code (B) when inheriting class's destructor calls it - 3850 // Object.Destructor.By Inheritor # 3850 OOP.Object.Destructor.By Inheritor ? OOP.Object.Variable.Public.By Object Function > {{ public: (){ = ;<< ;} ; protected: private: } : public { public: (){(); = ;<< ;} ; protected: private: } (){ = (); = ; << ; } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Assigning base class object to derived class variable - 3900 // Object.Assignment.Aggregate.Assigning base object to derived variable # 3900 OOP.Object.Assignment.Aggregate.Assigning base object to derived variable > {{ public: (){ = ;<< ;} protected: private: ; } : public { public: (){(); = R2#6<=R2<=9;#>;<< ;} protected: private: ; } (){ = (); } > Type: debug_output Languages: C++ Hardness: 10 # 3901 OOP.Object.Assignment.Aggregate.Assigning base object to derived variable > {{ public: (){>> ;<< ;} protected: ; private: } : public { public: (){();>> ;<< ;} protected: ; private: } (){ = (); } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Assigning derived class object to base class variable - 3925 // Object.Assignment.Aggregate.Assigning derived object to base variable # 3925 OOP.Object.Assignment.Aggregate.Assigning derived object to base variable ? OOP.Object.{Variable.Protected.By Object Function,Constructor.By Client,Constructor.Inheritor.Coopted} > {{ public: (){ = ;<< ;} protected: ; private: } : public { public: (){(); = R2#6<=R2<=9;#>;<< ;} protected: ; private: } (){ = (); } > Type: debug_output Languages: C++ Hardness: 10 # 3926 OOP.Object.Assignment.Aggregate.Assigning derived object to base variable ? OOP.Object.{Variable.Private.By Object Function,Constructor.By Client,Constructor.Inheritor.Coopted} > {{ public: (){>> ;<< ;} protected: private: ; } : public { public: (){();>> ;<< ;} protected: private: ; } (){ = (); } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Assigning object of one derived class to variable of another derived class - 3950 // Object.Assignment.Aggregate.Assigning derived object to different derived variable # 3950 OOP.Object.Assignment.Aggregate.Assigning derived object to different derived variable > {{ public: (){ = ;<< ;} protected: private: ; } : public { public: (){(); = R2#6<=R2<=9;#>;<< ;} protected: ; private: } : public { public: (){(); = R3#11<=R3<=14;#>;<< ;} ; protected: private: } (){ = .(); } > Type: debug_output Languages: C++ Hardness: 10 # 3951 OOP.Object.Assignment.Aggregate.Assigning derived object to different derived variable > {{ public: (){>> ;<< ;} ; protected: private: } : public { public: (){();>> ;<< ;} protected: ; private: } : public { public: (){();>> ;<< ;} protected: private: ; } (){ = (); } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // ================================================================================= // // Called in ancestor function, which is in turn called by client // // Accessing public (B) data member by ancestral class - 4000 // Object.Variable.Public.By Ancestor # 4000 OOP.Object.Variable.Public.By Ancestor > {{ public: (){=;<< ; =;} ; protected: private: } : public { public: ; protected: private: } (){ = (); .();} } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (B) data member by ancestral class - 4025 // Object.Variable.Protected.By Ancestor # 4025 OOP.Object.Variable.Protected.By Ancestor > {{ public: (){>> ; >> ; << ;} protected: ; private: } : public { public: (){>> ;<< ;} protected: ; private: } (){ = (); .();} } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) data member by ancestral class - 4050 // Object.Variable.Private.By Ancestor # 4050 OOP.Object.Variable.Private.By Ancestor > {{ public: (){>> ; = ; << ;} protected: private: ; } : public { public: protected: (){>> ;; >> ;<< - ;} private: ; } (){ = (); .();} } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Called in inheritor function, which is in turn called by client // // Accessing public (B) member function by ancestral class - 4100 // Object.Function.Public.By Ancestor # 4100 OOP.Object.Function.Public.By Ancestor > {{ public: (){>> ;<< ; ();} protected: ; private: } : public { public: (){>> ; << ;} protected: ; private: } (){ = (); .();} } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (B) member function by ancestral class - 4125 // Object.Function.Protected.By Ancestor # 4125 OOP.Object.Function.Protected.By Ancestor > {{ public: (){ = ;<< ; = * 10; ();} protected: private: ; } : public { public: protected: (){ = ; << ;} private: ; } (){ = (); .();} } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) member function by ancestral class - 4150 // Object.Function.Private.By Ancestor # 4150 OOP.Object.Function.Private.By Ancestor > {{ public: (){>> ; << (); << ;} protected: ; private: } : public { public: ; protected: private: (){>> ;<< ;return ;} } (){ = (); .();} } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing public (B) data member wrt ancestral object by client - 4200 // Object.Variable.Public.Wrt Ancestor # 4200 OOP.Object.Variable.Public.Wrt Ancestor > {{ public: (){=;<< ;} protected: ; private: } : public { public: ; (){return ;} protected: private: } (){ = (); = ; . = ; << ;} } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (D) data member wrt ancestral object by client - 4225 // Object.Variable.Protected.Wrt Ancestor # 4225 OOP.Object.Variable.Protected.Wrt Ancestor > {{ public: (){>> ; = + 1; << ;} protected: private: ; } : public { public: (){>> ; = - 1; << ;} protected: ; private: } (){ = (); >> .; .();} } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) data member wrt ancestral object by client - 4250 // Object.Variable.Private.Wrt Ancestor # 4250 OOP.Object.Variable.Private.Wrt Ancestor > {{ public: (){>> ; = * 10; << ;} protected: ; private: } : public { public: protected: (){>> ; = * 2; << ;} private: ; } (){ = (); .(); . = ;} } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing public (B) member function wrt ancestral object by client - 4300 // Object.Function.Public.Wrt Ancestor # 4300 OOP.Object.Function.Public.Wrt Ancestor > {{ public: (){ = ;<< ;} protected: private: ; } : public { public: (){>> ; << ;} protected: private: ; } (){ = (); .();} } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing protected (D) member function wrt ancestral object by client - 4325 // Object.Function.Protected.Wrt Ancestor # 4325 OOP.Object.Function.Protected.Wrt Ancestor > {{ public: (){ = ;<< ;} protected: private: ; } : public { public: protected: (){ = ; << ;} private: ; } (){ = (); = ; .();} } > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // // Accessing private (D) member function wrt ancestral object by client - 4350 // Object.Function.Private.Wrt Ancestor # 4350 OOP.Object.Function.Private.Wrt Ancestor > {{ public: (){; >> ; >> ; if( < ){ << ; }else << ;} protected: private: ; } : public { public: protected: ; private: (){>> ;<< ;return ;} } (){ = (); << .(); } } > Input: "\n\n\n" > Type: debug_output Languages: C++ Hardness: 10 // --------------------------------------------------------------------------------- // Used solely for testing code # 9000 OOP.Object.Variable.Public.By Object Function > {{ public: (){ = 29; << ;} (){return ;} (){if( >= 0){ =;} else { = 1;}} static (){<< ;} (){<< ;} ; static ; protected: // [5]; private: ; } { public: (){return ;} (){ = 51; << ;} ; private: ; } { public: ; (){ = 51; << ;} } (){ = .(); =13; >> ; . = ; << .(); = .(); // Following statement leads to stack overflow - why? // >> ..; . = ; << .(); = .(); }} > Input: "\n\n" > Type: debug_output Languages: C++ Hardness: 10