Question: multiple choice questions/c++ dont care I solved last night. . SECTXOKA: MULTINA CIOCES SIXCLEAKSWIR QUESTIONS 1 Surat The OLX.betra Turku Ladrat CADC tubu . WIR

 multiple choice questions/c++ dont care I solved last night. . SECTXOKA:

multiple choice questions/c++

MULTINA CIOCES SIXCLEAKSWIR QUESTIONS 1 Surat The OLX.betra Turku Ladrat CADC tubu

. WIR . We Two na ww.. CO trent: . c. teden

H. DREW COSTI A Ratta --- L. EL. P. St. LS -

11 ... ILIK w ..........1 ME Nr. Palit Trad SYST 1: TI

is ... . ! STR. . G. WITH-LIVE TIIN.... e ***pady CH

Far: betweets 11 the C ...Exter DEJE Str. Eure Cat .. CHE

dont care I solved last night.

. SECTXOKA: MULTINA CIOCES SIXCLEAKSWIR QUESTIONS 1 Surat The OLX.betra Turku Ladrat CADC tubu . WIR . We Two na ww.. CO trent: . c. teden H. DREW COSTI A Ratta --- L. EL. P. St. LS - 11 ... ILIK w ..........1 ME Nr. Palit Trad SYST 1: TI is ... . ! STR. . G. WITH-LIVE TIIN.... e ***pady CH Far: betweets 11 the C ...Exter DEJE Str. Eure Cat .. CHE T! WWW * Www.paypancab. ins. facxaca de Rates . kodin Edt . en IL-H.WT HEN HERBERT HH.. Cloux STRE PAINMNITATE ng !! pra: CE!!! LEHET CE!! CSE SI -1931 13.01.12 1.230. 1: INITAS TINTAS 2-3 22 1. 20 - . 20 29 14 A PARITER 17 2,565 P1799.9 CC 20 I! CSI) TE PC - 18 TIS. D. p!!! the - T.C. 11 T. C. 2 . Tauru 1. We Jack TELE WILL DER Skrum . DERESU. CI ... CVE-pel LEK COSIB RILLER PERTRAKTORY PERRY coded IEEE Is Lakini wapya BRIL 1. Who wird! EXK HEKTY Gabi 5 I. WWWWWWMW 1 widther TEND E CE 12. ah CES Core: 100 Wu'il Twitter list.lullleri 2. Tedy WR. DOTI GUIA CELCOME AU RO CORD 14 Wich delalang Kotbalstalogas PERSIRAT SA ini II. Anware L. OLE SEXETaitouin LLAWER EXEXUARI Tp. 2. aast C. 1. Worry festivin 6 6 L. 2 CLER KIMAS no Ecobacte: WAS. What is CCRRECT NURA 10.31: thinterey th:10.02 C. this Pin L. hab. STU BARILE" 7 13 Wed,FALSE SOME Arum wwwtwiteracking E. RETT. C. ORIGIakha Vapa nendid 2 + teabep wel_ DUR F....... ! C. IX EXTERIES 21 Wideni 2. e Warner 13. 8 SELLINU: NULLU'LE CHE ES NULLU'L: AXSWELS 125 18 : ThuwanNE . Warth ETURAT .YMEST KOTISIVU Ndihma ktheu EE, Thoma Finest t. With a rais restoranti Ches:11 can 8 1x Alter by 1. Seda FR.it F THE 2 we 2 B E dhire UL. 212. panty 2.4. Naras. WEEKH ce Truck Apabi E. . L. ALE ni TWIN 9 3. With the STEYENE HYLD. > AS wirkt 1!. Endered ex Frul test batean L. Annalisa dado de al Dategies Yurtra 4. Laat 3. CASA DE LLUELISTIK M. SN F FER AAUYT VOIT 1. LEER METAL D. Cette E ADAMS E The Bouw CV 10 1. Which of the following statements is TRUE about aggregation in Object-Oriented Programming (OOP)? A. It provides a way to generalize classes. B. It allows member functions or methods of a class to behave differently C. It models cases where two objects may have relationship, however they can exist independently. D. It models relationships where an object owns other objects. 2 2. Which one of the following cases forms a composition relationship? A. Students and their contact information B. Course assignments and students C. Students and enrolled courses. D. Teachers and students they teach. Question 3, 4, and 5 are based on the class diagram in Figure A-I. Contact phone email Student Advisor name name program faculty Figure A-1 1 3. Which one of the following code segments is the CORRECT way to implement the class Student? Assume that the class Contact and Advisor have been implemented correctly. A. class Student B. class Student:public Contact string name, program; string name, program; Contact contact; Advisor advisor; Advisor advisor; }; C. class Student string name, program; Contact *contact; }; D. class Student string name, program; Contact *contact: Advisor advisor; }; 4. What does the class diagram in Figure A-1 tell? A. Contact is a parent class B. Each advisor has a reference to a student. C. Students may share the same contact information. D. Advisors may share the same contact information. 5. Which one of the following code segments is the CORRECT way to implement the class Advisor? Assume that the class Contact has been implemented correctly. A class Advisor B. class Advisor:public Contact string name, faculty; string name, faculty; Contact *contact; }; Student student; }; D C. class Advisor string name, faculty; Contact contact; class Advisor string name, faculty; Contact contact: }; 6. Which one of the followings is TRUE about inheritance in OOP? A. It models an "has a" relationship between classes. B. It allows the parent class to inherit the attributes and methods from the child classes. C. The parent class represents common characteristics shared by the child classes. D. It provides a way to create new objects from existing objects. Question 7 and 8 are based on the class diagram in Figure A-2. Vehicle Car Truck E Question 7 and 8 are based on the class diagram in Figure A-2. Vehicle 4 Car Truck 4 Figure A-2 7. What does the class diagram in Figure A-2 tell? A. The class Car is a specific version of class Vehicle B. The class Truck is a general form of class Vehicle. C. The class Vehicle links the class Car and Truck together. D. The class Vehicle extends the class Car and Truck. . 8. Assume that the class diagram in Figure A-2 has been implemented correctly in C++. Here, three classes are defined with names Vehicle, Car and Truck, respectively. Then, some objects are created from these classes as follows: : Vehicle vi, v2; Car c; Truck to Which one of the following statements is able to compile? At = c; B. C = C = v ; ; C. t - v2; D. vl = t t 9. Which one of th followings is an example where the concept of polymorphism can be applied to? A. Two rectangles have the same width but different lengths. B. The circumference of a circle can be calculated from its diameter, while for a rectangle, it is based on its width and length. C. A circle and rectangle can be specified with colors, however the colors might be different, for example the circle's color is red, while the rectangle's is blue. D. Two circles have the same center location but different diameters 10. Inheritance can be used for the following purposes EXCEPT A. Defining a class that represents common characteristics shared between classes. B. Hiding the implementation details of a class. C. Extending a class to a more specific one. D. Preparing the structure for polymorphism. Question 11, 12, and 13 are based on the Program A-1 1 // Program A-1 2 3 class Course! string title; 5 public: 6 Course () { cout whoAMT(); p->print(); A. I am the parent class Course's Title: Python Course's Fee: 100 B. I am the parent class Course's Title: Python C I am the child class Course's Fee: 100 D. I am the child class Course's Title: Python Course's Poe: 100 12. What does the code at line 15 do? A To override all the methods print(). B. To declare the method print () to use static binding, C. To specify the method print so that it will be bound at run-time. 12. What does the code at line 15 do? A. To override all the methods print(). B. To declare the method print to use static binding C. To specify the method print (so that it will be bound at run time. D. To specify the class Course as an abstract class 13. What would the following code segement print? Course *course; PaidCourse *paidCourse =new PaidCourse(); course = paidCourse; APRO B. QR2 C. O SRP D. PRSO 6 14. Which of the followings is an example use case where it is better handled with exceptions? A. The intended output from a program is 28, however the program shows an output of 10. instead. B. A program does not compile due to missing function definition C. Code in a program may access an array element beyond the range, D. A program cannot compile due to missing semicolon. 15. In order to implement the concept of polymorphism, classes must be in relationship A inheritance B. composition C. association D. aggregation 16. What type of errors that exception handling is used for? A. Linking errors B. Typo errors C. Run-time errors D. Compiling errors 17. Consider a code segment that throws an exception below. Which of the following codes is CORRECT to catch the exception. try /*some code go here/ throw 10.01; } 7 A. catch(int e) { /*some code go here) B. catch (10.01) 1/"some code go here"/ ) C. catch istring e) { /*some code go here*/ } D. catch (double e) { /*some code go here*/ } 18. Which one of the followings is FALSE about composition relationships? A. The existence of the enclosed (or the content) objects depends on the enclosing (or the container) objects. B. Composition is implemented using pointers. C. Composition models a "whole-part" relationship. D. Composition can be used for cases where an object owns other objects. 19. In C++, function templates work based on A. Data value B. Function name C. Data type D. Function parameters 20. What is the main advantage of using templates? A. Reduce code duplication B. Code reusability C. Make program running faster HI 18. Which one of the followings is FALSE about composition relationships? A. The existence of the enclosed (or the content) objects depends on the enclosing (or the container) objects. ) B. Composition is implemented using pointers. C. Composition models a whole-part" relationship, D. Composition can be used for cases where an object owns other objects. 19. In C++, function templates work based on A. Data value B. Function name C. Data type D. Function parameters 20. What is the main advantage of using templates ? A. Reduce code duplication B. Code reusability C. Make program running faster D. Error handling 8 8 SECTION B: MULTIPLE CHOICES MULTIPLE ANSWERS : 125 Marks) Instruction: This section consists of TEN (10) questions. Each question can have either TWO (2) or THREE (3) correct answers as stated in each question. Each correct answer is worth 1 mark You MUST NOT choose more than the amount required. Any additional choice will be deducted by 1 mark. For example, if the question states, "Choose THREE correct answers", and you choose five, then 2 marks will be deducted for that question Write your answers clearly, 1. Which of the following objects may form a composition relationship? Choose THREE (3) correct answers. 1. Students and enrolled courses B. Lecturers and their contact information C. Authors and their books D. Students and their biodata E. Books and their chapters F. Lecturers and students 2. Given a class diagram in Figure B-1. List THREE Object-Orlented Programming (OOP) concepts adopted in the class diagram Vehicle Car Truck Figure B-1 9 A. Encapsulation B. Inheritance C. Aggregation D. Polymorphism E. Composition E. Generalization 3. Which of the following statements : TRUE atomlan attract class in C++? Chew TWO (2) correct answers. A. A class that inherits from an abstract class must define the pure virtual methods. B. If the destructor of a class is declared as pure virtual, then the class also becomes abstract C. A class becomes an abstract class only if all its methods are declared as pure virtual D. An object can be created from an abstract class as long as it does not call to any of pure virtual methods of the class. 4. Consider the class diagram in Figure B 2. Choose THREE (3) CORRECT statements based on the class diagram Staff 4 18. Which one of the followings is FALSE about composition relationships? A. The existence of the enclosed (or the content) objects depends on the enclosing for the container) objects. B. Composition is implemented using pointers. C. Composition models a "whole part" relationship. D. Composition can be used for cases where an object owns other objects. 19. In C++, function templates work based on A Data value B. Function name C. Datatype D. Function parameters 20. What is the main advantage of using templates? A. Reduce code duplication B. Code reusability C. Make program running faster D. Error handling 8 8 SECTION B: MULTIPLE CHOICES MULTIPLE ANSWERS [25 Marks Instruction: This section consists of TEN (10) questions Each question can have either TWO (2) or THREE (3) correct answers as stated in each question. Each correct answer is worth 1 mark. You MUST NOT choose more than the amount required. Any additional choice will be deducted by 1 mark. For example, if the question states, "Choose THREE correct answers" and you choose five, then 2 marks will be deducted for that question Write your answers clearly. 1. Which of the following objects may form a composition relationship? Choose THREE (3) correct answers. A. Students and enrolled courses B. Lecturers and their contact information C. Authors and their books D. Students and their biodata E. Books and their chapters F. Lecturers and students 2. Given a class diagram In Figure B-1. List THREE Object-Oriented Programming (OOP) concepts adopted in the class diagram. Vehicle 4 Car Truck Figure B-1 9 A Encapsulation B. Inheritance C. Aggregation D. Polymorphism E. Composition F. Generalization 3. Which of the following statements are TRUE about an abstract class in C++? Chouxe TWO (2) correct answers. A. A class that inherits from an abstract class must define the pure virtual methods. B. If the destructor of a class is declared as pure virtual, then the class also becomes abstract. C. A class becomes an abstract class only if all its methods are declared as pure virtual. D. An object can be created from an abstract class as long as it does not call to any of pure virtual methods of the class. 4. Consider the class diagram in Figure B-2. Chexse 'THREE (3) CORRECT statements based on the class diagram Start . SECTXOKA: MULTINA CIOCES SIXCLEAKSWIR QUESTIONS 1 Surat The OLX.betra Turku Ladrat CADC tubu . WIR . We Two na ww.. CO trent: . c. teden H. DREW COSTI A Ratta --- L. EL. P. St. LS - 11 ... ILIK w ..........1 ME Nr. Palit Trad SYST 1: TI is ... . ! STR. . G. WITH-LIVE TIIN.... e ***pady CH Far: betweets 11 the C ...Exter DEJE Str. Eure Cat .. CHE T! WWW * Www.paypancab. ins. facxaca de Rates . kodin Edt . en IL-H.WT HEN HERBERT HH.. Cloux STRE PAINMNITATE ng !! pra: CE!!! LEHET CE!! CSE SI -1931 13.01.12 1.230. 1: INITAS TINTAS 2-3 22 1. 20 - . 20 29 14 A PARITER 17 2,565 P1799.9 CC 20 I! CSI) TE PC - 18 TIS. D. p!!! the - T.C. 11 T. C. 2 . Tauru 1. We Jack TELE WILL DER Skrum . DERESU. CI ... CVE-pel LEK COSIB RILLER PERTRAKTORY PERRY coded IEEE Is Lakini wapya BRIL 1. Who wird! EXK HEKTY Gabi 5 I. WWWWWWMW 1 widther TEND E CE 12. ah CES Core: 100 Wu'il Twitter list.lullleri 2. Tedy WR. DOTI GUIA CELCOME AU RO CORD 14 Wich delalang Kotbalstalogas PERSIRAT SA ini II. Anware L. OLE SEXETaitouin LLAWER EXEXUARI Tp. 2. aast C. 1. Worry festivin 6 6 L. 2 CLER KIMAS no Ecobacte: WAS. What is CCRRECT NURA 10.31: thinterey th:10.02 C. this Pin L. hab. STU BARILE" 7 13 Wed,FALSE SOME Arum wwwtwiteracking E. RETT. C. ORIGIakha Vapa nendid 2 + teabep wel_ DUR F....... ! C. IX EXTERIES 21 Wideni 2. e Warner 13. 8 SELLINU: NULLU'LE CHE ES NULLU'L: AXSWELS 125 18 : ThuwanNE . Warth ETURAT .YMEST KOTISIVU Ndihma ktheu EE, Thoma Finest t. With a rais restoranti Ches:11 can 8 1x Alter by 1. Seda FR.it F THE 2 we 2 B E dhire UL. 212. panty 2.4. Naras. WEEKH ce Truck Apabi E. . L. ALE ni TWIN 9 3. With the STEYENE HYLD. > AS wirkt 1!. Endered ex Frul test batean L. Annalisa dado de al Dategies Yurtra 4. Laat 3. CASA DE LLUELISTIK M. SN F FER AAUYT VOIT 1. LEER METAL D. Cette E ADAMS E The Bouw CV 10 1. Which of the following statements is TRUE about aggregation in Object-Oriented Programming (OOP)? A. It provides a way to generalize classes. B. It allows member functions or methods of a class to behave differently C. It models cases where two objects may have relationship, however they can exist independently. D. It models relationships where an object owns other objects. 2 2. Which one of the following cases forms a composition relationship? A. Students and their contact information B. Course assignments and students C. Students and enrolled courses. D. Teachers and students they teach. Question 3, 4, and 5 are based on the class diagram in Figure A-I. Contact phone email Student Advisor name name program faculty Figure A-1 1 3. Which one of the following code segments is the CORRECT way to implement the class Student? Assume that the class Contact and Advisor have been implemented correctly. A. class Student B. class Student:public Contact string name, program; string name, program; Contact contact; Advisor advisor; Advisor advisor; }; C. class Student string name, program; Contact *contact; }; D. class Student string name, program; Contact *contact: Advisor advisor; }; 4. What does the class diagram in Figure A-1 tell? A. Contact is a parent class B. Each advisor has a reference to a student. C. Students may share the same contact information. D. Advisors may share the same contact information. 5. Which one of the following code segments is the CORRECT way to implement the class Advisor? Assume that the class Contact has been implemented correctly. A class Advisor B. class Advisor:public Contact string name, faculty; string name, faculty; Contact *contact; }; Student student; }; D C. class Advisor string name, faculty; Contact contact; class Advisor string name, faculty; Contact contact: }; 6. Which one of the followings is TRUE about inheritance in OOP? A. It models an "has a" relationship between classes. B. It allows the parent class to inherit the attributes and methods from the child classes. C. The parent class represents common characteristics shared by the child classes. D. It provides a way to create new objects from existing objects. Question 7 and 8 are based on the class diagram in Figure A-2. Vehicle Car Truck E Question 7 and 8 are based on the class diagram in Figure A-2. Vehicle 4 Car Truck 4 Figure A-2 7. What does the class diagram in Figure A-2 tell? A. The class Car is a specific version of class Vehicle B. The class Truck is a general form of class Vehicle. C. The class Vehicle links the class Car and Truck together. D. The class Vehicle extends the class Car and Truck. . 8. Assume that the class diagram in Figure A-2 has been implemented correctly in C++. Here, three classes are defined with names Vehicle, Car and Truck, respectively. Then, some objects are created from these classes as follows: : Vehicle vi, v2; Car c; Truck to Which one of the following statements is able to compile? At = c; B. C = C = v ; ; C. t - v2; D. vl = t t 9. Which one of th followings is an example where the concept of polymorphism can be applied to? A. Two rectangles have the same width but different lengths. B. The circumference of a circle can be calculated from its diameter, while for a rectangle, it is based on its width and length. C. A circle and rectangle can be specified with colors, however the colors might be different, for example the circle's color is red, while the rectangle's is blue. D. Two circles have the same center location but different diameters 10. Inheritance can be used for the following purposes EXCEPT A. Defining a class that represents common characteristics shared between classes. B. Hiding the implementation details of a class. C. Extending a class to a more specific one. D. Preparing the structure for polymorphism. Question 11, 12, and 13 are based on the Program A-1 1 // Program A-1 2 3 class Course! string title; 5 public: 6 Course () { cout whoAMT(); p->print(); A. I am the parent class Course's Title: Python Course's Fee: 100 B. I am the parent class Course's Title: Python C I am the child class Course's Fee: 100 D. I am the child class Course's Title: Python Course's Poe: 100 12. What does the code at line 15 do? A To override all the methods print(). B. To declare the method print () to use static binding, C. To specify the method print so that it will be bound at run-time. 12. What does the code at line 15 do? A. To override all the methods print(). B. To declare the method print to use static binding C. To specify the method print (so that it will be bound at run time. D. To specify the class Course as an abstract class 13. What would the following code segement print? Course *course; PaidCourse *paidCourse =new PaidCourse(); course = paidCourse; APRO B. QR2 C. O SRP D. PRSO 6 14. Which of the followings is an example use case where it is better handled with exceptions? A. The intended output from a program is 28, however the program shows an output of 10. instead. B. A program does not compile due to missing function definition C. Code in a program may access an array element beyond the range, D. A program cannot compile due to missing semicolon. 15. In order to implement the concept of polymorphism, classes must be in relationship A inheritance B. composition C. association D. aggregation 16. What type of errors that exception handling is used for? A. Linking errors B. Typo errors C. Run-time errors D. Compiling errors 17. Consider a code segment that throws an exception below. Which of the following codes is CORRECT to catch the exception. try /*some code go here/ throw 10.01; } 7 A. catch(int e) { /*some code go here) B. catch (10.01) 1/"some code go here"/ ) C. catch istring e) { /*some code go here*/ } D. catch (double e) { /*some code go here*/ } 18. Which one of the followings is FALSE about composition relationships? A. The existence of the enclosed (or the content) objects depends on the enclosing (or the container) objects. B. Composition is implemented using pointers. C. Composition models a "whole-part" relationship. D. Composition can be used for cases where an object owns other objects. 19. In C++, function templates work based on A. Data value B. Function name C. Data type D. Function parameters 20. What is the main advantage of using templates? A. Reduce code duplication B. Code reusability C. Make program running faster HI 18. Which one of the followings is FALSE about composition relationships? A. The existence of the enclosed (or the content) objects depends on the enclosing (or the container) objects. ) B. Composition is implemented using pointers. C. Composition models a whole-part" relationship, D. Composition can be used for cases where an object owns other objects. 19. In C++, function templates work based on A. Data value B. Function name C. Data type D. Function parameters 20. What is the main advantage of using templates ? A. Reduce code duplication B. Code reusability C. Make program running faster D. Error handling 8 8 SECTION B: MULTIPLE CHOICES MULTIPLE ANSWERS : 125 Marks) Instruction: This section consists of TEN (10) questions. Each question can have either TWO (2) or THREE (3) correct answers as stated in each question. Each correct answer is worth 1 mark You MUST NOT choose more than the amount required. Any additional choice will be deducted by 1 mark. For example, if the question states, "Choose THREE correct answers", and you choose five, then 2 marks will be deducted for that question Write your answers clearly, 1. Which of the following objects may form a composition relationship? Choose THREE (3) correct answers. 1. Students and enrolled courses B. Lecturers and their contact information C. Authors and their books D. Students and their biodata E. Books and their chapters F. Lecturers and students 2. Given a class diagram in Figure B-1. List THREE Object-Orlented Programming (OOP) concepts adopted in the class diagram Vehicle Car Truck Figure B-1 9 A. Encapsulation B. Inheritance C. Aggregation D. Polymorphism E. Composition E. Generalization 3. Which of the following statements : TRUE atomlan attract class in C++? Chew TWO (2) correct answers. A. A class that inherits from an abstract class must define the pure virtual methods. B. If the destructor of a class is declared as pure virtual, then the class also becomes abstract C. A class becomes an abstract class only if all its methods are declared as pure virtual D. An object can be created from an abstract class as long as it does not call to any of pure virtual methods of the class. 4. Consider the class diagram in Figure B 2. Choose THREE (3) CORRECT statements based on the class diagram Staff 4 18. Which one of the followings is FALSE about composition relationships? A. The existence of the enclosed (or the content) objects depends on the enclosing for the container) objects. B. Composition is implemented using pointers. C. Composition models a "whole part" relationship. D. Composition can be used for cases where an object owns other objects. 19. In C++, function templates work based on A Data value B. Function name C. Datatype D. Function parameters 20. What is the main advantage of using templates? A. Reduce code duplication B. Code reusability C. Make program running faster D. Error handling 8 8 SECTION B: MULTIPLE CHOICES MULTIPLE ANSWERS [25 Marks Instruction: This section consists of TEN (10) questions Each question can have either TWO (2) or THREE (3) correct answers as stated in each question. Each correct answer is worth 1 mark. You MUST NOT choose more than the amount required. Any additional choice will be deducted by 1 mark. For example, if the question states, "Choose THREE correct answers" and you choose five, then 2 marks will be deducted for that question Write your answers clearly. 1. Which of the following objects may form a composition relationship? Choose THREE (3) correct answers. A. Students and enrolled courses B. Lecturers and their contact information C. Authors and their books D. Students and their biodata E. Books and their chapters F. Lecturers and students 2. Given a class diagram In Figure B-1. List THREE Object-Oriented Programming (OOP) concepts adopted in the class diagram. Vehicle 4 Car Truck Figure B-1 9 A Encapsulation B. Inheritance C. Aggregation D. Polymorphism E. Composition F. Generalization 3. Which of the following statements are TRUE about an abstract class in C++? Chouxe TWO (2) correct answers. A. A class that inherits from an abstract class must define the pure virtual methods. B. If the destructor of a class is declared as pure virtual, then the class also becomes abstract. C. A class becomes an abstract class only if all its methods are declared as pure virtual. D. An object can be created from an abstract class as long as it does not call to any of pure virtual methods of the class. 4. Consider the class diagram in Figure B-2. Chexse 'THREE (3) CORRECT statements based on the class diagram Start

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!