Principalsofprogramminglanguagesse.files.wordpress.com



1. Which of the following is the sequqnce of activities included in waterall model? A. SRS, Development, Verifiction, MaintenanceB. Requirement, Design, Implementation, Verification,Maintenance C. Requirement, Design, Implementation, MaintenanceD. SRS, Design, DevelopmentANSWER: B2. .................... is a splitting of software development work into distinct phases (or stages) containing activities with the intent of better planning and management.A. Software Development life CycleB. Software DesignC. Software ExecutionD. Software DeploymentANSWER: A3. ........... refers to the extent to which a software/Web application may be divided into smaller modules.A. ModularityB. InheritanceC. EncapsulationD. ClassANSWER: A4. A software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules is known as..........A. Functional ProgrammingB. Modular ProgrammingC. ProgrammingD. Software DesigningANSWER: B5. Which of the following is/are concept(s) used to support modularity for programmingA. EncapsulationB. interfaceC. Seperate compilationD. All of the aboveANSWER: D6. ALGOL 68-R, ALGOL 68C and Mesa language are example of ......... language.A. StructuredB. ScriptingC. ModularD. none of the aboveANSWER: C7. Encapsulation helpsA. information hidingB. in providing low couplingC. in providing high cohesionD. All the aboveANSWER: D8. Which of the these is the functionality of ‘Encapsulation’?A. Binds together code and dataB. Using single interface for general class of actions.C. Reduce ComplexityD. All of the mentionedANSWER: A9. What is the output of this program? class Test { int a; public int b; private int c; } class AcessTest { public static void main(String args[]) { Test ob = new Test(); ob.a = 10; ob.b = 20; ob.c = 30; System.out.println(" Output :a, b, and c" + ob.a + " " + ob.b + " " + ob.c); } }A. Compilation errorB. Run time errorC. Output : a, b and c 10 20 30D. None of the mentionedANSWER: A10. Which of these can be used to fully abstract a class from its implementation?A. ObjectsB. PackagesC. InterfacesD. None of the Mentioned.ANSWER: C11. The method of compilation in which compilation unit can be compiled at different times, but their compilations are not independent of each other if either accesses or uses any entities of the other IS KNOWN AS.........A. Seperate compilationB. Independent compilationC. both A and BD. None of the aboveANSWER: A12. With ................, program units can be compiled without information about any other program units.A. Seperate compilationB. Independent compilationC. both A and BD. None of the aboveANSWER: B13. An important characteristic of independent compilation is that the interfaces between the separately compiled units are ........... for consistency.A. not checked B. Always CheckedC. Sometime checkedD. partially checkedANSWER: A14. Which operator is used to signify the namespace?A. conditional operatorB. ternary operatorC. scope operatorD. none of the mentionedANSWER: C15. Identify the correct statement.a. Namespace is used to group class, objects and functions.b. Namespace is used to mark the beginning of the program.c. Namespace is used to seperate the class, objects.d. None of the aboveANSWER: a16. What is the use of Namespace?a. To encapsulate the datab. To structure a program into logical units.c. Both a and bd. none of the mentionedANSWER: b17. What is the output of this program? #include <iostream> using namespace std; namespace first { int var = 5; } namespace second { double var = 3.1416; } int main () { int a; a = first::var + second::var; cout << a; return 0; }A. 8.1416B. 5C. 8D. 5.31416ANSWER: C18. What is the output of this program? #include <iostream> using namespace std namespace space { int x = 10; } namespace space { int y = 15; } int main(int argc, char * argv[]) { space::x = space::y =5; cout << space::x << space::y; }A. Compile time errorB. 55C. 5D. 1015ANSWER: B19. Which keyword is used to declare the friend function?a. firendb. friendc. classfriendd. myfriendANSWER: b20. Which rule will not affect the friend function?a. private and protected members of a class cannot be accessed from outsideb. private and protected member can be accessed anywherec. both a & bd. None of the mentionedANSWER: a21. What is the output of this program? #include <iostream> using namespace std; class sample; class sample1 { int width, height; public: int area () { return (width * height);} void convert (sample a); }; class sample { private: int side; public: void set_side (int a) { side = a; } friend class sample1; }; void sample1::convert (sample a) { width = a.side; height = a.side; } int main () { sample sqr; sample1 rect; sqr.set_side(6); rect.convert(sqr); cout << rect.area(); return 0; }A. 24B. 35C. 16D. 36ANSWER: D22. In a program, If there exists a function template with two parameters and normal function say void add(int , int), so add(3,4) will _____________________ .A. Invoke function template body as it is generic oneB. Invokes normal function as it exactly matches with its prototypeC. Not be called and Compiler issues warningD. Not be called and Compiler issues ambiguity in calling add()ANSWER : B23.If abstract class is inherited by derived class, then_______________ .a. Derived class should provide definition for all the pure virtual functionsb. Derived class also become abstract if fails to implement pure virtual functionsc. Objects of derived class can’t be created if it fails to implement pure virtual functionsd. All of these ANSWER : d24. To display two private data members from one object of a class,A. create a member function to preserve data hidingB. create a friend function to implement object oriented programmingC. create both friend and member functions to give the programmer a choiceD. not create a function, but just display the data members directly.ANSWER: A25. Select the correct statement of the following?A. A class declaration must state which functions will be its friendsB. A friend function must declare to which classes it will be a friendC. Both (a) and (b)D. None of theseANSWER: A ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download