V. Meena took a C++ exam with 50 questions. She scored 50 out of 60 marks. The document provides her exam answers and the correct answers to each question.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
27 views
C++ Practice Sheet
V. Meena took a C++ exam with 50 questions. She scored 50 out of 60 marks. The document provides her exam answers and the correct answers to each question.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5
Student Name V.
MEENA
Subject CPLUS Admit Card No. PASS
Exam. Date 2020-02-04 Marks Scored 50 / 60
1. Polymorphism is used to __________?
Answered : D) used in different ways Correct Answer is : D) used in different ways ______________________________________________________________________ 2. Which of the following concepts means wrapping up of data and functions together? Answered : B) Encapsulation Correct Answer is : B) Encapsulation ______________________________________________________________________ 3. Which of the following is correct about the statements given below? I.All operators can be overloaded in C++. II.We can change the basic meaning of an operator in C++. Answered : B) Both I and II are false. Correct Answer is : B) Both I and II are false. ______________________________________________________________________ 4. Which of the following statement is correct? Answered : C) Class is an instance of data type. Correct Answer is : C) Class is an instance of data type. ______________________________________________________________________ 5. Which of the following functions are performed by a constructor? Answered : D) Initialize objects Correct Answer is : D) Initialize objects ______________________________________________________________________ 6. Pick the odd one out. Answered : C) integer, enum, void Correct Answer is : C) integer, enum, void ______________________________________________________________________ 7. Where does keyword ?friend? should be placed? Answered : d) None of the mentioned Correct Answer is : a) function declaration ______________________________________________________________________ 8. The fields in the class in c++ program are by default Answered : d) none of the mentioned Correct Answer is : d) none of the mentioned ______________________________________________________________________ 9. Which of the following operators cannot be overloaded? Answered : C) ?: Correct Answer is : C) ?: ______________________________________________________________________ 10. Pick the odd one out Answered : A) array type Correct Answer is : A) array type ______________________________________________________________________ 11. Setbase is used to? Answered : A)converse the base value to another base value Correct Answer is : A)converse the base value to another base value ______________________________________________________________________ 12. Which of the following provides a reuse mechanism? Answered : B) Inheritance Correct Answer is : B) Inheritance ______________________________________________________________________ 13. When a language has the capability to produce new data type mean, it can be called as Answered : B) extensible Correct Answer is : B) extensible ______________________________________________________________________ 14. Data abstraction is used to __________? Answered : B)is to reveal only important Correct Answer is : B)is to reveal only important ______________________________________________________________________ 15. How to declare a template? Answered : c) template<> Correct Answer is : c) template<> ______________________________________________________________________ 16. Which of the following problem causes an exception? Answered : D) A run-time error. Correct Answer is : D) A run-time error. ______________________________________________________________________ 17. Which of the following ways are legal to access a class data member using this pointer? Answered : A) this->x Correct Answer is : A) this->x ______________________________________________________________________ 18. Setw is used to? Answered : B)set the width of output Correct Answer is : B)set the width of output ______________________________________________________________________ 19. Which of the following is not the member of class? Answered : C) Const function Correct Answer is : B) Friend function ______________________________________________________________________ 20. How "Late binding" is implemented in C++? Answered : B) Using Virtual tables Correct Answer is : B) Using Virtual tables ______________________________________________________________________ 21. The data elements in structure are also known as what? Answered : b) members Correct Answer is : b) members ______________________________________________________________________ 22. How many operators are there in dynamic memory allocation? Answered : B)2 Correct Answer is : B)2 ______________________________________________________________________ 23. Why constructor is used? Answered : C)to initialize an object Correct Answer is : C)to initialize an object ______________________________________________________________________ 24. What does a escape code represent? Answered : A) alert Correct Answer is : A) alert ______________________________________________________________________ 25. In manipulator the header file must have #include____? Answered : D)iomanip.h Correct Answer is : D)iomanip.h ______________________________________________________________________ 26. With which does the trigonometric functions work with angles in c++? Answered : b) Radians Correct Answer is : b) Radians ______________________________________________________________________ 27. How many types of inheritation are there? Answered : D)4 Correct Answer is : D)4 ______________________________________________________________________ 28. Identify the user-defined types from the following? Answered : C) both a and b Correct Answer is : C) both a and b ______________________________________________________________________ 29. Encapsulation is used to __________? Answered : A)is to hide Correct Answer is : A)is to hide ______________________________________________________________________ 30. Which of the following statements are true? int f(float) Answered : A) f is a function taking an argument of type int and retruning a floating point number Correct Answer is : B) f is a function taking an argument of type float and returning a integer. ______________________________________________________________________ 31. Which keyword is used to declare the friend function? Answered : b) friend Correct Answer is : b) friend ______________________________________________________________________ 32. What will happen if a class is not having any name? Answered : D) Both A and B. Correct Answer is : D) Both A and B. ______________________________________________________________________ 33. Which of the following statements is correct? Answered : B) Derived class pointer cannot point to base class. Correct Answer is : B) Derived class pointer cannot point to base class. ______________________________________________________________________ 34. What is the index number of the last element of an array with 9 elements? Answered : b) 8 Correct Answer is : b) 8 ______________________________________________________________________ 35. Which of the following keyword is used to overload an operator? Answered : B) operator Correct Answer is : B) operator ______________________________________________________________________ 36. Inheritance is used to __________? Answered : C)to modify from existing Correct Answer is : C)to modify from existing ______________________________________________________________________ 37. what is the syntax for delete operator? Answered : c)delete pointer Correct Answer is : D)delete pointer; ______________________________________________________________________ 38. Which of the following is a mechanism of static polymorphism? Answered : D) All of the above Correct Answer is : D) All of the above ______________________________________________________________________ 39. Which of the following statement is correct? Answered : A) Class is an instance of object. Correct Answer is : B) Object is an instance of a class. ______________________________________________________________________ 40. Void pointer can point to which type of objects? Answered : C) double Correct Answer is : D) all of the mentioned ______________________________________________________________________ 41. Which operator works only with integer variables? Answered : c) both a & b Correct Answer is : c) both a & b ______________________________________________________________________ 42. Early binding is also known as ? Answered : A)static Correct Answer is : A)static ______________________________________________________________________ 43. Which datatype is used to represent the absence of parameters? Answered : B) short Correct Answer is : C) void ______________________________________________________________________ 44. Which of these following members are not accessed by using direct member access operator? Answered : D) Both b & c Correct Answer is : D) Both b & c ______________________________________________________________________ 45. Dynamic binding is also known as? Answered : A)late Correct Answer is : A)late ______________________________________________________________________ 46. Setfill is used to? Answered : C)fill the given character in unused field Correct Answer is : C)fill the given character in unused field ______________________________________________________________________ 47. C++ was designed using Clanguage and __________? Answered : C)simula 67 Correct Answer is : C)simula 67 ______________________________________________________________________ 48. In C++ the header file must have #include____? Answered : B)iostream.h Correct Answer is : B)iostream.h ______________________________________________________________________ 49. How many character set are there in c++? Answered : D)9 Correct Answer is : D)9 ______________________________________________________________________ 50. Which of the following statements regarding inline functions is correct? Answered : C) It increases the code size. Correct Answer is : D) Both A and C. ______________________________________________________________________ 51. Pick out the correct option. Answered : c) Both a & b Correct Answer is : a) We cannot make an instance of an abstract base class ______________________________________________________________________ 52. Which keyword is used to define the user defined data types? Answered : C) typedef Correct Answer is : C) typedef ______________________________________________________________________ 53. What is the use of Namespace? Answered : b) To structure a program into logical units. Correct Answer is : b) To structure a program into logical units. ______________________________________________________________________ 54. C++ is based on OPP's concept. Answered : A)true Correct Answer is : A)true ______________________________________________________________________ 55. Which of the following is not a type of inheritance? Answered : C) Distributive Correct Answer is : C) Distributive ______________________________________________________________________ 56. Which of the following access specifier is used as a default in a class definition? Answered : C) private Correct Answer is : C) private ______________________________________________________________________ 57. What are the parts of the literal constants? Answered : D) all of the mentioned Correct Answer is : D) all of the mentioned ______________________________________________________________________ 58. Which of the following statement is correct? Answered : C) A constructor is called at the time of declaration of a class. Correct Answer is : A) A constructor is called at the time of declaration of an object. ______________________________________________________________________ 59. Which of the following is the correct class of the object cout? Answered : C) ostream Correct Answer is : C) ostream ______________________________________________________________________ 60. Which of the following header file includes definition of cin and cout? Answered : D) iostream.h Correct Answer is : D) iostream.h ______________________________________________________________________