Selective Questions 1About packaging, the following statements are incorrect () (A) By encapsulation, all attributes and operations of the object are combined to form a whole. (B) By encapsulation, the implementation details of an object are hidden as much as possible (see not necessarily) (C) By encapsulation, each object becomes a relatively independent entity. (D) By encapsulation, the attributes of objects are invisible. 2Assuming that AA is a class and int a () is a member function of the class, if the member function is defined outside the class, the function head is () (A) int AA::a() (B) int AA:a() (C) AA:: a () (D) AA:: int a () 3Can a class allow a parametric constructor and a constructor with all default parameters to coexist? () (A) No permission (B) (C)Uncertainty of (D) Visual Constructor 4In C++, CIN is a () (A) Class (B) Object (C) Template (D) Function 5Destructive function is used to initialize ((A) general member function. (B) Class initialization (C) Initialization of objects (D) Complete some cleanup before deleting objects created by classes 6Assuming that a class AB contains a floating-point data member a, when the user does not define any constructor, the system defines a parametric constructor for that class as () (A) AB() {a = 0;} (B) AB (float a a = 0): a (aa) {} (C) A () {} (D) AB() {} 7C++ language comes from the gradual development and evolution of C language.Compared with C, the most significant improvement in solving problems is () (A) "Process Oriented (B)" Object Oriented (C) Security (D) Complex Usability 8C++ source file extension () (A). CPP (B). exe (C). obj (D). lik 9In the following statements, not only is the constructor characterized by () (A) The function name of the constructor is the same as the class name. (B) Constructors can be overloaded (C) Constructors can set default parameters (D) Constructors must specify type descriptions 10Function overload refers to (A) (A) Two or more functions have the same function name, but the number or type of formal parameters are different. (B) Two or more functions have the same name and the same number of parameters, but the types of parameters can be different. (C) The names of two or more functions are different, but the number or type of parameters are the same (D). Two or more functions have the same function name, and the return type of the function is the same. 11. There are the following class definitions: class MyClass {int Value; Public: MyClass (int n): Value (n) {}// If not, Automatically generates defaults // copy constructor //The assignment constructor int GetValue () {return Value;}}; In MyClass, the number of constructors is () (A) 1 (B) 2 (C) 3 (D) 4 12. The three major features of object-oriented programming do not include () A: Encapsulation B: Inheritance C: Polymorphism D: Robustness 13. In C++ language, the problem of data encapsulation is () A: Data Normalization B: It's not convenient for data conversion C: Avoiding Data Loss D: Preventing Illegal Access of Data Between Different Modules 14. In the following items, the condition that the overload of the function must be full is that A: There must be different number of parameters B: The corresponding parameter types must not be the same C: A and B must be full at the same time. Foot D: A and B should only be full at the same time. 15. Among the following storage class identifiers, functions are required to achieve a function that is not too complex, and to speed up the execution speed. Selection of () is appropriate. A: Inline function; B: overloaded function; C: recursive modulation; D: nested modulation. 16. In the following statements about class definitions, the correct one is () A: Class definitions include declarations of data members and function members B: The default access rights of class members are protected C: Data members must be declared private D: Membership functions can only be defined outside the class 17. In the prototype description of four groups of functions, the overloading rule of full-foot C++ functions is A: float f (float x); void f (float y); B: float f (float x); void F2 (float x, float y); C: float f (float x, int y); void f (float y); D: float f (float y); float f (floaty); 18. The description of a member function in known class A is as follows: Void Set (A & a); then the function parameter "A & a" means A: The pointer to A is a B: Assigning the address of variable a to

docxDoc C++ Question Bank (with Answers)

Professional Docs > Common > Other > Preview
12 Pages 0 Downloads 69 Views 3.0 Score
Tips: Current document can only be previewed at most page8,If the total number of pages in the document exceeds page 8,please download the document。
Uploaded by admin on 2019-10-15 12:08:57
You can enter 255 characters
What is my domain?( )
  • No comments yet