0% found this document useful (0 votes)
11 views2 pages

May 23

mamths

Uploaded by

Aswath Aswath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

May 23

mamths

Uploaded by

Aswath Aswath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
». Write « CPP program to demonstrate the working of STL stack with the STL functions. PART ~C (1x 15=15 Marks) ‘Answer ANY ONE Question 26. Create a class named ‘Triangle’ with two private data members, hase and height and one function to calculate the area of triangle. The class should have the following constructors: () Having no parameter — values of both base and height are assigned (Having evo parameters — to assign values to base and height (i) Having one parameter ~ sssign value through parameter for base and assign height iv) Having a copy constructor to copy values of one objet to another (Create objects forthe classes and calculate the area of triangle and print the 27. Write a CPP program forthe below mentioned hybrid inheritance scenario: Create @ class ‘student’ to get the student details. Inberit a class named Marks" from ‘Sraden cass to calculate the marks of stadents. Next, create a class ‘sports’ to get the sports marks. Finally, create a class ‘Result’ inherited from ‘Marks’ and ‘sports’ to calculate the overall result and average (overall results will be from marks and sports marks), Present [eno B.Tech M-Tech (Integrated) DEGREE EXAMINATION, MAY 2023, ‘Second & Third Semester 21CSC10)T - OBJECT ORIENTED DESIGN AND PROGRAMMING (Por the candidates ccmited from the academic year 2022-2023 onwards) Note: ()Part= stout be answered in OM set within Sat 40 minutes an OM shertshauld Ye Randel over ‘ofall viata a the ond of 40 inte. (G)Part-DandPare=C shuld be anoere ia answer booklet ‘Time: 3 Hours Max. Marks: 75 PART— A @01=20Mari3) ee “Answer ALL Questions Which feature of OOP indicates code reusability? ee (A) Absizaction| (B) Encapsulation (©) Inheritance ©) Polymorphism Which ofthe following statement iste forthe command: aes int loa) (A) fie fametion taking an argument (B) fis a fiction taking an ‘of type int and retuning a argument of type float and foating-poin number retuming an ineger (© fisatimetion oftype fost ——_(D) isa faction of ype int . Kdentfy the comet way to declare @ constant data type using preprocessor 1 7 1 2 dicecive in CH? (A) eefine iat a= 100 @) MaeGinea~100 (©) tein ita 100 (D) Aaefine a 100 Which ofthe following access specifier allows the user t inherit the private 11! 2 members ofa class? (A) Public (B) Protected (©) Defuut () Private . What happens its user forges to define a constructor inside a clas? hoa (A) Brnor occurs (B) Segmentation fait (©) Objects arenot created properly (D) Compiler provides. defmlt : constructor to avoid. falls 1 Which ofthe ftlowing peents faction overloading on C++? aes (A) Type of arguments (B) Number of ergumens (©) ‘Type and mumberofxgumeats (D) Number oF objects, Which ofthe Zliowing C++ operatn(s) can be averioaded? ee (A) Size operator (size of) {B) Conditional operator (2) (©) Aritmetic operator (+-.e/), __(D) Class Member Access Operator ° Sequence and collaboration diagrams are (A) UML interaction diagrams (B) UML static diagrams (© UME strcturl diggrams (D) UML implementation diagrams Identify what happens when a attempt is made to instantiate an object of an abstract class. (A). Success message (B) Waring message (©) Compilation error (D) Objects gets created ‘In mutilevel inheritance one class inherits (A) Only from one class (B) More than one class (©) Aleast one class (D) Asmany classes as required 11. The double line filled cizcle with pointing arrow is _ (A) Sart state (B) Final stare (©) Transition state (D) Composite state 12. An inline function i expanded during (A) Compile time ®B) Runtime (©) Never expanded (D) End of program 13, What are templates in C42 (A) A feature that allows programmer (B) A feature that allows to write generic programs programmer 1 write specific ‘codes fora problem (©) A feature that allows programmer (D) A feanute that does not add any ‘tomake program modular power to the language 14, What is an exception in C++ program? (A) A problem that arses during the (B) A problem that arises during ‘execution of a program. compilation (©) Synimx error (D) Semantic exor 1s. is used 10 visualize the topology of the physical components of stem, (A) Class diagram (B) Sequence diagram (C) Deployment diggram (D) Package diagram 16. The __ block identifies a block of code for which a particular exception wil Be wotvated oy (B) throw (©) cateh (D) Gnally 17. How many components Standard Template Library (STL) has? @ @ 2 3 @ 4 18, What are iterators? (A) Mterators are used to iterate over (B) Tterators are containers fanetions (©) lterators are used to iterate over (D) ltertors are like pointers that pointer pints to an clement inside the 19. 20 2ha 2a 23.0, dha 28.4, esate Which function is used to access the frst clement ofan array class? , (A) feont() B) start) (©) fist (D) beck) is a procedure that is used to process the data contained in containers. @® Algorithm (B) erator (©) Pointer (D) Object PART -B(Sx “Answer ALL Questions Write a CPP program to calculate and display the area of a rectangle. Createa class with two private data members length and breadth and three functions First function to get the values of length and breadth, second function to calculate the area and third function to display the area. Length and bread should be entered by the ser. (or) Draw the UML use case diagram for the library management system. The * system will ave two users Librarian and student with the following fnetions. “Librarian functions: Add books, Add student, Add publication, Issue book, Return book, Apply penalty, View report ‘Student functions: Search book, Issue book, Return book, Penalty report ‘Change password. Write a CPP program to add and subtract two complex numbers using * ‘operator overloading concept. (OR) Create the sequence and collaboration diagram for withdrawal senso inthe & Dank ATM system. The system stars the process by employing a standard procedure for validating the card and account holder. Write a CPP program to differentiate early binding and late binding with the * help of vimwal functions. (or) Draw the activity diagram with swim lanes for railway reservation system, ‘The passenger should be able to book ticket in online railway reservation system, The diagram should itcude fork, joint, decision ete. Write a CPP program to find the largest of two numbers using function ¢ templates. (oR) Develop the components and deployment diagram for online banking system. * Explain in detail about the components that make up the Standard Template * Libraries (STL), (on) 10 Marks) cae

You might also like