CS304 Object Oriented Programming Final Term

Size: px
Start display at page:

Download "CS304 Object Oriented Programming Final Term"

Transcription

1 1. Which of the following is the way to extract common behaviour and attributes from the given classes and make a separate class of those common behaviours and attributes? Generalization (pg 29) Sub-typing Specialization Extension 2. Abstraction is a feature of OOP which enables an object to Increase Complexity Decrease Complexity (pg 21) Increase Modularity Decrease Modularity 3. In a class, objects cannot- have common. Behaviour Attributes States Names 4. Which of the following is an example of multiple inheritances? Student Woman (Lecture 5) Mermaid Train 5. A C++ class is similar to a. Structure (pg65) Header File Library File Function 6. Which of the following is used to free the memory space allocated as a result of object declaration? Constructor New operator Destructor (pg 81) Accessor Function 7. and methods may not be declared abstract. 1

2 Private,Static Private,Public Static,Public Static, Protected 8. If a static variable is not explicitly initialized at the time of its definition then, The compiler will give an error message The compiler will give a warning message The compiler will initialize it with value Zero. (pg 107 ) The program terminates 9. Object cannot be declared constant if it is required to change the state of its. Constant data members (pg 105) Non-constant data members Constant member functions Static data members 10. A friend function can access a class s private data without being a. Static member of the class None member of the class Member of the class (pg 135) Constant member of the class 11. Identify which of the following overloaded operator function s declaration is appropriate for the given call? Rational_number_ Hint: Where Rational_number_1 is an object of user defined class Rational_number. Rational_number operator+( Rational_number & obj); Rational_number operator+(double& obj); (pg 145) Rational_number operator+(rational_number &obj, double& num); operator+(double& obj); 12. A class can be identified from a statement by Noun (pg 58) Pronoun Verb Adverb 13. The return type of a constructor is of Integer Character Double No type (pg74) 14. Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2. Identify the correct function prototype against the given call? A operator + ( A &obj); int + operator(); int operator (plus) (); (pg 143) A operator(a &obj3); 15. Abstract classes have..object/s, while concrete classes have..object/s. One, One More than one, more than one 2

3 No, One or more No, One 16. If MyClass has a destructor its name will be, MyClass ~MyClass (reference 232) My~Class MyClass~ 17. A static member function can be called, even when an object is not. Excecute Define Instantiated Mention 18. Consider the following code segment: void UserInfo (Complex & C1){ C1=C1; } It is an example of: Assignment Self assignment Compound assignment Multiple assignments 19. While overloading the stream insertion operator, the return type must be. Ostream (pg 156) Istream Instream Iostream 20. To overload subscript operator, it requires one type parameter. Int (pg 160) Float Char String 1. When the base class cannot be replaced by its derived class then it is called, Sub-typing (pg 31) Super-typing Generalization Specialization 2. Suppose that the Test class does not have an overloaded assignment operator. What happens when an assignment a=b; is given for two Test objects a and b? The automatic assignment operator is used The copy constructor is used Compiler error Run-time error 3. By default, which access level is assigned to members of a class? 3

4 Public Private Local Protected 4. In OOP's, advantage of inheritance include all of the given below except, Provide a useful conceptual framework Reusing the code (pg 26) Dealing with real world entities Decrease maintainability 5. Main problem(s) with multiple inheritances includes. Increased Complexity, Reduced Understanding, Less Reusability Increased Complexity, Decreased Code Redundancy, Less Reusability Increased Complexity, Reduced understanding, Duplicate Features (pg45) Increased Complexity, Less Reusability, Duplicate Features 6. Which is true about sub-typing in case of inheritance? In sub-typing derived class shows some extended behavior of its parent. (Pg. ) In sub-typing derived class shows some restricted behavior of its parent class. In sub-typing derived class should be abstract. Sub-typing has no relation with inheritance 7. The keyword tells the compiler to substitute the code within the function definition for every instance of a function call. Virtual Inline (Pg. 72) Instance Static 8. The function that is automatically called when an object of a class is created is named as. Constructor (Pg. 74) Destructor Member Functions Inline Functions 9. Which will be the good example of a method that is shared by all instances of a class? Virtual method Overloaded method Constant method Static method (Pg. 108) 10. If you do not initialize static variable of int type then it is automatically initialized with. 0 (Pg. 107) 1-1 Null 11. Which one is not keyword in C++? operator 4

5 B_op const using 12. We capture the object attributes and behavior in Object Oriented programming using Class (pg 15) Function Data Members Instances 13. The return type of a constructor is of Integer Character Double No type (pg 74) 14. For more than one member in initializes list, then we use to separate them. Dot (.) Comma (,) (pg 104) Colon (:) Semicolon(;) 15. Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 - obj2 to work correctly, if the overloaded - operator must Take two arguments. Return a value. Create a named temporary object. Take four arguments. 16. To convert from a user-defined class to a basic type, you would most likely use a conversion operator that s a member of the class. (pg168) a built-in conversion operator. a one-argument constructor. an overloaded = operator. 17. A generalization-specialization relation between classes are implemented using Data hiding Friend classes Encapsulation Inheritance (pg 49) 18. Operator overloading is: Making C++ operators able to work with objects. Giving C++ operators more than they can handle. (pg 139) Giving new meanings to existing Class members. Making new C++ operators. 19. The life of sub object is dependant on the life of master class in. Separation Composition (Pg. 120) Aggregation Association 20. operator will take only one operand. New Const Int 5

6 This 1. Which one of the following features of OOP is used to deal with only relevant details? Abstraction (pg 23) Information hiding Object Inheritance 2. Inheritance is a way to make general classes into more specific classes. (pg 27) pass arguments to objects of classes. improve data hiding and encapsulation. providing class growth through natural selection. 3. Consider the code below, class Fred { public: Fred();... }; int main() { Fred a[10]; Fred* p = new Fred[10];... } Select the best option, A) Fred a[10]; calls the default constructor 09 times Fred* p = new Fred[10]; calls the default constructor 10 times B) Produce an error C) Fred a[10]; calls the default constructor 11 times Fred* p = new Fred[10]; calls the default constructor 11 times (Pg. 175) D) Fred a[10]; calls the default constructor 10 times Fred* p = new Fred[10]; calls the default constructor 10 times 4. Which operator can not be overloaded? The relation operator ( >= ) Assignment operator ( = ) Script operator ( [] ) Conditional operator (? : ) (pg 141) 5. Abstraction is a feature of OOP which enables an object to Increase Complexity Decrease Complexity Increase Modularity Decrease Modularity 6. Composition is an example of relationship. Simple Complex Strong (Pg. 53) Weak 7. Consider a class having name MyClass, what will be the name of this class constructor? 6

7 MyClass Myclass myclass myclass 8. The function that is automatically called when an object of a class is created is named as. Constructor (Pg. 74) Destructor Member Functions Inline Functions 9. The const member functions uses following specifers. Only access Only read (Pg. 100) Access and read only Access, read, and modify 10. The life of sub object is not dependant on the life of master class in. Composition Aggregation (pg 134) Separation Abstraction 11. Friend functions are functions of a class. Object member Member Non-member (pg 136) Static member 12. Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2. Identify the correct function prototype against the given call? A operator + ( A &obj); int + operator(); (pg 143) int operator (plus) (); A operator(a &obj3); 13. A generalization-specialization relation between classes are implemented using Data hiding Friend classes Encapsulation Inheritance (pg 49) 14. A real world object s attributes are represented through, Member function Data members(pg. 14) Global variables Const data members 15. Why we should avoid the use of friend function/class? Friend function/class minimizes encapsulation (Pg. 153) Difficult to use Decreases complexity Increase program code size 16. Which of the following is NOT an advantage of information hiding? Simplifies the model 7

8 Restriction to change Prevents damage from errant external code Provide direct access to data members 17. Assume that a user wants to count, how many objects are created for a particular class, which one will be most suitable to perform this task: Const data member Non static data member Static data member Global data member 18., which means if A declares B as its friend it does NOT mean that A can access private data of B. It only means that B can access all data of A. Friendship is one way only (Pg.292 ) Friendship is two way only NO Friendship between classes Any kind of friendship 19. Consider the following code segment: void UserInfo (Complex & C1){ C1=C1; } It is an example of: Assignment Self assignment (Pg. 151) Compound assignment Multiple assignment 20. Subscript operator must be of the class when overloaded. Static function Virtual function Member function (pg 160) Non member function 1. What is a class? A class is a section of computer memory containing objects. A class is a section of the hard disk reserved for object oriented programs A class is the part of an object that contains the variables. A class is a description of a kind of object. 2. Suppose that the Test class does not have an overloaded assignment operator. What happens when an assignment a=b; is given for two Test objects a and b? The automatic assignment operator is used The copy constructor is used Compiler error Run-time error 3. Consider the following statement. "Cupboard has books" What is the relationship between Cupboard and books? 8

9 Composition Aggregation (Pg. 54) Inheritance Association 4. Which of the following is directly related to polymorphism? Const members Overriding (pg ) Static members Const members functions 5. The constructor of a class is called when An object is change its state An object is executed An object is created (pg 74) An object is destroyed 6. Which will be the good example of a method that is shared by all instances of a class? Virtual method Overloaded method Constant method Static method 7. The const member functions uses following specifers. Only access Only read (Pg. 100) Access and read only Access, read, and modify 8. Friend functions are functions of a class. Object member Member Non-member (pg 136) Static member 9. The return type of a constructor is of Integer Character Double No type (Pg. 74) 9

10 10. For more than one member in initializer list, then we use to separate them. Dot (.) Comma (,) (Pg. 104) Colon (:) Semicolon(;) 11. Given the following class class Base{ int Age=33; } How you can improve above class with respect to accessing the field Age? Define the variable Age as private Define the variable Age as protected Define the variable Age as private and create a get method that returns it and a set method that updates it Define the variable Age as protected and create a set method that returns it and a get method that updates it 12. A normal C++ operator that acts in special ways on newly defined data types is said to be Glorified. Encapsulated. Classified. Overloaded. 13. To convert from a user-defined class to a basic type, you would most likely use a conversion operator that s a member of the class. a built-in conversion operator. a one-argument constructor. an overloaded = operator. 14. A generalization-specialization relation between classes are implemented using Data hiding Friend classes Encapsulation Inheritance (Pg. 49) 15. Abstract classes have..object/s, while concrete classes have..object/s. One, One More than one, more than one No, One or more (Pg. 229) No, One 16. Hiding details of an object from the other parts of a program is done by which principle of OOP? Obfustication Data Mining Compilation Encapsulation (pg 16) 10

11 17. Graphical representation of the classes and objects is called object model it shows Class name, Attributes, States, Operations Class name, Attributes, Operations, Methods Class name, Attributes, Operations, Behaviour Class name, Attributes, Operations, Relationship 18. Consider the following function: void multiplication (int x, int y); If we overloaded the above function, then it will require. operands. One Two Three Four 19. Consider the following code segment: void UserInfo (Complex & C1){ C1=C1; } It is an example of: Multiple assignment Assignment Self assignment (Pg. 151) Compound assignment 20. While overloading the stream extraction operator, the return type must be. Ostream Iostream Istream Instream 1.Which one of the following is not a major element of an Object Model? Abstraction Encapsulation Persistence Hierarchy 2. Encapsulation is a feature of Object Oriented Programming which means, Keep data separated from code Keep data and code in a single place (Pg. ) Keep data separated from code and also keep data and code in a single place Reusing code by creating new classes from previously created classes 3. Reusability can be achieved through. Inheritance Aggregation Association Abstraction 4. Which of the following is directly related to polymorphism? 11

12 Const members Overriding Static members Const members functions 5. Which of the class s members are available to every one? Public Private Protected Internal 6. A member function having the same name as the class name preceded by a tilde (~) sign is called. Constructor Getter Setter Destructor (pg 92) 7. Which of the following is used to free the memory space allocated as a result of object declaration? Constructor New operator Destructor (Pg. 81) Accessor Function 8. provide the facility to access the data member. Accesser function (pg 68) Private function Inline function Constructor 9. What will be the value of the variable data and data2 respectively, If the function below is called 4 times? void func() { static int data = 4; int data2 = 4; ++data; ++data2; } 8, 5 5, 8 5, 5 7, In, a pointer or reference to an object is created inside a class. Aggregation (Pg. 134) Composition Separation Association 12

13 11. Identify which of the following overloaded operator function s declaration is appropriate for the given call? Rational_number_ Hint: Where Rational_number_1 is an object of user defined class Rational_number. Rational_number operator+( Rational_number & obj); Rational_number operator+(double& obj); (Pg. 145) Rational_number operator+(rational_number &obj, double& num); operator+(double& obj); 12. We capture the object attributes and behavior in Object Oriented programming using Instances Class (pg 15) Function Data Members 13. A normal C++ operator that acts in special ways on newly defined data types is said to be Glorified. Encapsulated. Classified. Overloaded. 14. Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2. Identify the correct function prototype against the given call? A operator + ( A &obj); int + operator(); int operator (plus) (); (pg 143) A operator(a &obj3); 15. A generalization-specialization relation between classes are implemented using Data hiding Friend classes Encapsulation Inheritance (pg 49) 16. The technique in which we visualize our programming problems according to real life s problems is called. Structured programming Object oriented programming (pg 9) Procedural programming Sequential programming 17. How many objects for a class can be constructed in an application? Only one per constructor. As many as the application asks for. Only one per class. One object per variable. 18. We change the evaluation precedence of operators through operator overloading. 13

14 Can Can not Only Just 19. Subscript operator must be of the class when overloaded. Static function Virtual function Member function (Pg. 160) Non member function 20. friend Complex & operator -(Complex & t); It is the declaration of: Unary minus member function Unary minus non member function Unary minus static member function Unary minus non static member function 1. Inheritance is a way to organize data. pass arguments to objects of classes. add features to existing classes without rewriting them. (pg 27) improve data-hiding and encapsulation. 2. The ability to derive a class from more than one classes is called, Single inheritance Encapsulation Multiple inheritance Polymorphism 3. For classes with common behavior, you can save effort by placing the common behavior in a. Derived Class Base class (pg 29) Deprived Class Named class 4. If Rollno is a const data member of a class student then which definition is correct for the member function show () int show() const { return Rollno; } void show() const { return Rollno; } int show() const { return Rollno + 50; } int show(num) const { Rollno = num; } 5. An overloaded operator always requires argument than its number of operands. One less (pg 896) One most Two less Three most 6. Which of the following is a weak relationship between two objects? Inheritance Composition Aggregation 14

15 Association 7.The constructor of a class is called when An object is change its state An object is executed An object is created An object is destroyed 8. The function that is automatically called when an object of a class is created is named as. Constructor (Pg. 74) Destructor Member Functions Inline Functions 9. Which of the following is used to free the memory space allocated as a result of object declaration? Constructor New operator Destructor (Pg. 92) Accessor Function 10. Separation of implementation from interface provides the facility to restrict the from direct access. Data member Data function Class Object (Pg. 19) 11. "This pointer" does not pass implicitly to functions. Static member (Pg. 114) Non-static member Instance member Constant member 12. In, a pointer or reference to an object is created inside a class. Aggregation (Pg. 133) Composition Separation Association 13. A class can be identified from a statement by Noun Pronoun Verb Adverb 14. By default all members of a class are, Public Protected Private Public & protected 15. Graphical representation of the classes and objects is called object model it shows Class name, Attributes, States, Operations Class name, Attributes, Operations, Methods Class name, Attributes, Operations, Behaviour Class name, Attributes, Operations, Relationship 15

16 16. Why we should avoid the use of friend function/class? Friend function/class minimizes encapsulation Difficult to use Decreases complexity Increase program code size 17. Operator overloading is: Making C++ operators able to work with objects. Giving C++ operators more than they can handle. Giving new meanings to existing Class members. Making new C++ operators. 18. Which of the following operator can not be overloaded? Scope resolution operator ( :: ) (pg 141) Insertion operator ( << ) Extraction operator ( >> ) The relation operator ( > ) 19 Consider the following code segment: void UserInfo (Complex & C1){ C1=C1; } It is an example of: Assignment Self assignment Compound assignment Multiple assignment 20.Subscript operator must be of the class when overloaded. Static function Virtual function Member function Non member function 1. Which one of the following features of OOP is used to derive a class from another? Encapsulation Polymorphism Data hiding Inheritance (pg 25) 2. Which sentence clearly defines an object? one instance of a class. another word for a class. a class with static methods. a method that accesses class attributes. 3. If Rollno is a const data member of a class student then which definition is correct for the member function show () int show() const { return Rollno; } void show() const { return Rollno; } int show() const { return Rollno + 50; } int show(num) const { Rollno = num; } 4. Suppose that the Test class does not have an overloaded assignment operator. What happens when an assignment a=b; is given for two Test objects a and b? The automatic assignment operator is used The copy constructor is used 16

17 Compiler error Run-time error 5. Abstract class has. Zero Instances (there is no object) One Instance Two Instances Many Instances 6. Consider a class having name MyClass, what will be the name of this class constructor? MyClass Myclass myclass myclass 7. Which of the following is used to free the memory space allocated as a result of object declaration? Constructor New operator Destructor Accessor Function 8. The const member functions uses following specifers. Only access Only read Access and read only (Pg. 106) Access, read, and modify 9. What will be the value of the variable data and data2 respectively, If the function below is called 4 times? void func() { static int data = 4; int data2 = 4; ++data; ++data2; } 8, 5 5, 8 5, 5 7, Object cannot be declared constant if it is required to change the state of its. Constant data members Non-constant data members Constant member functions Static data members 11. In order to free the memory occupied by the object, we use Constructor Destructor Shallow Copy 17

18 Deep Copy 12. The property in which existing class is modified to form a new class is called.. Polymorphism Inheritance Encapsulation Information hiding 13. In inheritance hierarchy which one is on the top? Subtyping Specialization Extension Generalization 14. Graphical representation of the classes and objects is called object model it shows Class name, Attributes, States, Operations Class name, Attributes, Operations, Methods Class name, Attributes, Operations, Behaviour Class name, Attributes, Operations, Relationship 15. Why we should avoid the use of friend function/class? Friend function/class minimizes encapsulation Difficult to use Decreases complexity Increase program code size 16. In the following operators, the operator can be overloaded. % ##?:. 17. C2+C1 is equivalent to, when plus operator is overloaded, and C2, C1 are objects. C1.operator + (C2) C1.operator + (C1) C2.operator + (C1) C2.operator + (C2) 18.Consider the following code segment: void UserInfo (Complex & C1){ 18

19 C1=C1; } It is an example of: Assignment Self assignment Compound assignment Multiple assignment 19. To overload subscript operator, it requires one type parameter. Int Float Char String 20. Friend Complex & operator -(Complex & t); It is the declaration of: Unary minus member function Unary minus non member function (Pg. 162) Unary minus static member function Unary minus non static member function 19

CS304 Object Oriented Programming

CS304 Object Oriented Programming 1 CS304 Object Oriented Programming 1. Which of the following is the way to extract common behaviour and attributes from the given classes and make a separate class of those common behaviours and attributes?

More information

CS304- Object Oriented Programming LATEST SOLVED MCQS FROM FINALTERM PAPERS. MC

CS304- Object Oriented Programming LATEST SOLVED MCQS FROM FINALTERM PAPERS. MC CS304- Object Oriented Programming LATEST SOLVED MCQS FROM FINALTERM PAPERS JAN 28,2011 MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 FINALTERM EXAMINATION 14 Feb, 2011 CS304- Object Oriented

More information

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe OBJECT ORIENTED PROGRAMMING USING C++ CSCI 5448- Object Oriented Analysis and Design By Manali Torpe Fundamentals of OOP Class Object Encapsulation Abstraction Inheritance Polymorphism Reusability C++

More information

CLASSES AND OBJECTS IN JAVA

CLASSES AND OBJECTS IN JAVA Lesson 8 CLASSES AND OBJECTS IN JAVA (1) Which of the following defines attributes and methods? (a) Class (b) Object (c) Function (d) Variable (2) Which of the following keyword is used to declare Class

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming

KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming KOM3191 Object Oriented Programming Dr Muharrem Mercimek 1 OPERATOR OVERLOADING KOM3191 Object-Oriented Programming KOM3191 Object Oriented Programming Dr Muharrem Mercimek 2 Dynamic Memory Management

More information

C++ (Non for C Programmer) (BT307) 40 Hours

C++ (Non for C Programmer) (BT307) 40 Hours C++ (Non for C Programmer) (BT307) 40 Hours Overview C++ is undoubtedly one of the most widely used programming language for implementing object-oriented systems. The C++ language is based on the popular

More information

Object-Oriented Programming

Object-Oriented Programming - oriented - iuliana@cs.ubbcluj.ro Babes-Bolyai University 2018 1 / 56 Overview - oriented 1 2 -oriented 3 4 5 6 7 8 Static and friend elements 9 Summary 2 / 56 I - oriented was initially created by Bjarne

More information

FINAL TERM EXAMINATION SPRING 2010 CS304- OBJECT ORIENTED PROGRAMMING

FINAL TERM EXAMINATION SPRING 2010 CS304- OBJECT ORIENTED PROGRAMMING FINAL TERM EXAMINATION SPRING 2010 CS304- OBJECT ORIENTED PROGRAMMING Question No: 1 ( Marks: 1 ) - Please choose one Classes like TwoDimensionalShape and ThreeDimensionalShape would normally be concrete,

More information

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year Object Oriented Programming Assistant Lecture Omar Al Khayat 2 nd Year Syllabus Overview of C++ Program Principles of object oriented programming including classes Introduction to Object-Oriented Paradigm:Structures

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

More information

Intro to OOP Visibility/protection levels and constructors Friend, convert constructor, destructor Operator overloading a<=b a.

Intro to OOP Visibility/protection levels and constructors Friend, convert constructor, destructor Operator overloading a<=b a. Intro to OOP - Object and class - The sequence to define and use a class in a program - How/when to use scope resolution operator - How/when to the dot operator - Should be able to write the prototype

More information

Instantiation of Template class

Instantiation of Template class Class Templates Templates are like advanced macros. They are useful for building new classes that depend on already existing user defined classes or built-in types. Example: stack of int or stack of double

More information

C++ & Object Oriented Programming Concepts The procedural programming is the standard approach used in many traditional computer languages such as BASIC, C, FORTRAN and PASCAL. The procedural programming

More information

Programming, numerics and optimization

Programming, numerics and optimization Programming, numerics and optimization Lecture A-4: Object-oriented programming Łukasz Jankowski ljank@ippt.pan.pl Institute of Fundamental Technological Research Room 4.32, Phone +22.8261281 ext. 428

More information

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions.

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions. Dr.G.R.Damodaran College of Science (Autonomous, affiliated to the Bharathiar University, recognized by the UGC)Reaccredited at the 'A' Grade Level by the NAAC and ISO 9001:2008 Certified CRISL rated 'A'

More information

JAYARAM COLLEGE OF ENGINEERING AND TECHNOLOGY Pagalavadi, Tiruchirappalli (An approved by AICTE and Affiliated to Anna University)

JAYARAM COLLEGE OF ENGINEERING AND TECHNOLOGY Pagalavadi, Tiruchirappalli (An approved by AICTE and Affiliated to Anna University) Estd: 1994 JAYARAM COLLEGE OF ENGINEERING AND TECHNOLOGY Pagalavadi, Tiruchirappalli - 621014 (An approved by AICTE and Affiliated to Anna University) ISO 9001:2000 Certified Subject Code & Name : CS 1202

More information

Jayaram college of Engineering and Technology, Pagalavadi. CS2203 Object Oriented Programming Question Bank Prepared By: S.Gopalakrishnan, Lecturer/IT

Jayaram college of Engineering and Technology, Pagalavadi. CS2203 Object Oriented Programming Question Bank Prepared By: S.Gopalakrishnan, Lecturer/IT CS2203 Object Oriented Programming Question Bank Prepared By: S.Gopalakrishnan, Lecturer/IT Two Mark Questions UNIT - I 1. DEFINE ENCAPSULATION. Encapsulation is the process of combining data and functions

More information

(5 2) Introduction to Classes in C++ Instructor - Andrew S. O Fallon CptS 122 (February 7, 2018) Washington State University

(5 2) Introduction to Classes in C++ Instructor - Andrew S. O Fallon CptS 122 (February 7, 2018) Washington State University (5 2) Introduction to Classes in C++ Instructor - Andrew S. O Fallon CptS 122 (February 7, 2018) Washington State University Key Concepts Function templates Defining classes with member functions The Rule

More information

Object-Oriented Design (OOD) and C++

Object-Oriented Design (OOD) and C++ Chapter 2 Object-Oriented Design (OOD) and C++ At a Glance Instructor s Manual Table of Contents Chapter Overview Chapter Objectives Instructor Notes Quick Quizzes Discussion Questions Projects to Assign

More information

Object Oriented Programming. Solved MCQs - Part 2

Object Oriented Programming. Solved MCQs - Part 2 Object Oriented Programming Solved MCQs - Part 2 Object Oriented Programming Solved MCQs - Part 2 It is possible to declare as a friend A member function A global function A class All of the above What

More information

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR 603203 DEPARTMENT OF COMPUTER SCIENCE & APPLICATIONS QUESTION BANK (2017-2018) Course / Branch : M.Sc CST Semester / Year : EVEN / II Subject Name

More information

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University Lecture 3 COMP1006/1406 (the Java course) Summer 2014 M. Jason Hinek Carleton University today s agenda assignments 1 (graded) & 2 3 (available now) & 4 (tomorrow) a quick look back primitive data types

More information

Lecture 18 Tao Wang 1

Lecture 18 Tao Wang 1 Lecture 18 Tao Wang 1 Abstract Data Types in C++ (Classes) A procedural program consists of one or more algorithms that have been written in computerreadable language Input and display of program output

More information

Interview Questions of C++

Interview Questions of C++ Interview Questions of C++ Q-1 What is the full form of OOPS? Ans: Object Oriented Programming System. Q-2 What is a class? Ans: Class is a blue print which reflects the entities attributes and actions.

More information

CS304 Lecture Wise Questions by Virtualians Social

CS304 Lecture Wise Questions by Virtualians Social Lecture No 1: What is Object-oriented programming (OOP)? Object-oriented programming (OOP) is a programming paradigm using "objects" data structures consisting of data fields and methods together with

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Department of Computer science and Engineering Sub. Name: Object oriented programming and data structures Sub. Code: EC6301 Sem/Class: III/II-ECE Staff name: M.Kavipriya Two Mark Questions UNIT-1 1. List

More information

Ch. 12: Operator Overloading

Ch. 12: Operator Overloading Ch. 12: Operator Overloading Operator overloading is just syntactic sugar, i.e. another way to make a function call: shift_left(42, 3); 42

More information

Data Structures using OOP C++ Lecture 3

Data Structures using OOP C++ Lecture 3 References: th 1. E Balagurusamy, Object Oriented Programming with C++, 4 edition, McGraw-Hill 2008. 2. Robert L. Kruse and Alexander J. Ryba, Data Structures and Program Design in C++, Prentice-Hall 2000.

More information

AN OVERVIEW OF C++ 1

AN OVERVIEW OF C++ 1 AN OVERVIEW OF C++ 1 OBJECTIVES Introduction What is object-oriented programming? Two versions of C++ C++ console I/O C++ comments Classes: A first look Some differences between C and C++ Introducing function

More information

+2 Volume II OBJECT TECHNOLOGY OBJECTIVE QUESTIONS R.Sreenivasan SanThome HSS, Chennai-4. Chapter -1

+2 Volume II OBJECT TECHNOLOGY OBJECTIVE QUESTIONS R.Sreenivasan SanThome HSS, Chennai-4. Chapter -1 Chapter -1 1. Object Oriented programming is a way of problem solving by combining data and operation 2.The group of data and operation are termed as object. 3.An object is a group of related function

More information

Learning Objectives. C++ For Artists 2003 Rick Miller All Rights Reserved xli

Learning Objectives. C++ For Artists 2003 Rick Miller All Rights Reserved xli Identify and overcome the difficulties encountered by students when learning how to program List and explain the software development roles played by students List and explain the phases of the tight spiral

More information

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor. 3.Constructors and Destructors Develop cpp program to implement constructor and destructor. Constructors A constructor is a special member function whose task is to initialize the objects of its class.

More information

Object-Oriented Programming (OOP) Fundamental Principles of OOP

Object-Oriented Programming (OOP) Fundamental Principles of OOP Object-Oriented Programming (OOP) O b j e c t O r i e n t e d P r o g r a m m i n g 1 Object-oriented programming is the successor of procedural programming. The problem with procedural programming is

More information

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Chapter 6 Inheritance Extending a Class

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Chapter 6 Inheritance Extending a Class Chapter 6 Inheritance Extending a Class Introduction; Need for Inheritance; Different form of Inheritance; Derived and Base Classes; Inheritance and Access control; Multiple Inheritance Revisited; Multilevel

More information

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity.

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity. OOPS Viva Questions 1. What is OOPS? OOPS is abbreviated as Object Oriented Programming system in which programs are considered as a collection of objects. Each object is nothing but an instance of a class.

More information

Fast Introduction to Object Oriented Programming and C++

Fast Introduction to Object Oriented Programming and C++ Fast Introduction to Object Oriented Programming and C++ Daniel G. Aliaga Note: a compilation of slides from Jacques de Wet, Ohio State University, Chad Willwerth, and Daniel Aliaga. Outline Programming

More information

Cpt S 122 Data Structures. Introduction to C++ Part II

Cpt S 122 Data Structures. Introduction to C++ Part II Cpt S 122 Data Structures Introduction to C++ Part II Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Topics Objectives Defining class with a member function

More information

Data Structures (list, dictionary, tuples, sets, strings)

Data Structures (list, dictionary, tuples, sets, strings) Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in brackets: l = [1, 2, "a"] (access by index, is mutable sequence) Tuples are enclosed in parentheses: t = (1, 2, "a") (access

More information

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented Table of Contents L01 - Introduction L02 - Strings Some Examples Reserved Characters Operations Immutability Equality Wrappers and Primitives Boxing/Unboxing Boxing Unboxing Formatting L03 - Input and

More information

C++ Important Questions with Answers

C++ Important Questions with Answers 1. Name the operators that cannot be overloaded. sizeof,.,.*,.->, ::,? 2. What is inheritance? Inheritance is property such that a parent (or super) class passes the characteristics of itself to children

More information

CMSC 132: Object-Oriented Programming II

CMSC 132: Object-Oriented Programming II CMSC 132: Object-Oriented Programming II Java Support for OOP Department of Computer Science University of Maryland, College Park Object Oriented Programming (OOP) OO Principles Abstraction Encapsulation

More information

CMSC 202 Section 010x Spring Justin Martineau, Tuesday 11:30am

CMSC 202 Section 010x Spring Justin Martineau, Tuesday 11:30am CMSC 202 Section 010x Spring 2007 Computer Science II Final Exam Name: Username: Score Max Section: (check one) 0101 - Justin Martineau, Tuesday 11:30am 0102 - Sandeep Balijepalli, Thursday 11:30am 0103

More information

OBJ. ORI.& MULT. PROG., M.C.Q. BANK, FOR UNIT -2, SECOND YEAR COMP. ENGG. SEM-4, 2012 PATTERN, U.O.P. UNIT-2

OBJ. ORI.& MULT. PROG., M.C.Q. BANK, FOR UNIT -2, SECOND YEAR COMP. ENGG. SEM-4, 2012 PATTERN, U.O.P. UNIT-2 UNIT-2 Syllabus for Unit-2 Introduction, Need of operator overloading, overloading the assignment, binary and unary operators, overloading using friends, rules for operator overloading, type conversions

More information

An Introduction to C++

An Introduction to C++ An Introduction to C++ Introduction to C++ C++ classes C++ class details To create a complex type in C In the.h file Define structs to store data Declare function prototypes The.h file serves as the interface

More information

Module Operator Overloading and Type Conversion. Table of Contents

Module Operator Overloading and Type Conversion. Table of Contents 1 Module - 33 Operator Overloading and Type Conversion Table of Contents 1. Introduction 2. Operator Overloading 3. this pointer 4. Overloading Unary Operators 5. Overloading Binary Operators 6. Overloading

More information

Object Oriented Design

Object Oriented Design Object Oriented Design Lecture 3: Introduction to C++ (Continue) Examples using declarations that eliminate the need to repeat the std:: prefix 1 Examples using namespace std; enables a program to use

More information

ADTs & Classes. An introduction

ADTs & Classes. An introduction ADTs & Classes An introduction Quick review of OOP Object: combination of: data structures (describe object attributes) functions (describe object behaviors) Class: C++ mechanism used to represent an object

More information

Page No.1. CS304 OOP_ Muhammad Ishfaq

Page No.1. CS304 OOP_ Muhammad Ishfaq Page No.1 File Version Update: (Dated: 21-May-2011) This version of file contains: Content of the Course (Done) FAQ updated version.(these must be read once because some very basic definition and question

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University Day 4 COMP1006/1406 Summer 2016 M. Jason Hinek Carleton University today s agenda assignments questions about assignment 2 a quick look back constructors signatures and overloading encapsulation / information

More information

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak OBJECT ORIENTED PROGRAMMING Ms. Ajeta Nandal C.R.Polytechnic,Rohtak OBJECT ORIENTED PARADIGM Object 2 Object 1 Data Data Function Function Object 3 Data Function 2 WHAT IS A MODEL? A model is an abstraction

More information

STRUCTURING OF PROGRAM

STRUCTURING OF PROGRAM Unit III MULTIPLE CHOICE QUESTIONS 1. Which of the following is the functionality of Data Abstraction? (a) Reduce Complexity (c) Parallelism Unit III 3.1 (b) Binds together code and data (d) None of the

More information

THE NAME OF THE CONSTRUCTOR AND DESTRUCTOR(HAVING (~) BEFORE ITS NAME) FUNCTION MUST BE SAME AS THE NAME OF THE CLASS IN WHICH THEY ARE DECLARED.

THE NAME OF THE CONSTRUCTOR AND DESTRUCTOR(HAVING (~) BEFORE ITS NAME) FUNCTION MUST BE SAME AS THE NAME OF THE CLASS IN WHICH THEY ARE DECLARED. Constructor and Destructor Member Functions Constructor: - Constructor function gets invoked automatically when an object of a class is constructed (declared). Destructor:- A destructor is a automatically

More information

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Classes Chapter 4 Classes and Objects Data Hiding and Encapsulation Function in a Class Using Objects Static Class members Classes Class represents a group of Similar objects A class is a way to bind the

More information

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

Quiz Start Time: 09:34 PM Time Left 82 sec(s) Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability

More information

END TERM EXAMINATION

END TERM EXAMINATION END TERM EXAMINATION THIRD SEMESTER [BCA] DECEMBER 2007 Paper Code: BCA 209 Subject: Object Oriented Programming Time: 3 hours Maximum Marks: 75 Note: Attempt all questions. Internal choice is indicated.

More information

CS201 Latest Solved MCQs

CS201 Latest Solved MCQs Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

Chapter 5 Object-Oriented Programming

Chapter 5 Object-Oriented Programming Chapter 5 Object-Oriented Programming Develop code that implements tight encapsulation, loose coupling, and high cohesion Develop code that demonstrates the use of polymorphism Develop code that declares

More information

Inheritance, and Polymorphism.

Inheritance, and Polymorphism. Inheritance and Polymorphism by Yukong Zhang Object-oriented programming languages are the most widely used modern programming languages. They model programming based on objects which are very close to

More information

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia Object Oriented Programming in Java Jaanus Pöial, PhD Tallinn, Estonia Motivation for Object Oriented Programming Decrease complexity (use layers of abstraction, interfaces, modularity,...) Reuse existing

More information

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming Overview of OOP Object Oriented Programming is a programming method that combines: a) Data b) Instructions for processing that data into a self-sufficient object that can be used within a program or in

More information

Classes. Christian Schumacher, Info1 D-MAVT 2013

Classes. Christian Schumacher, Info1 D-MAVT 2013 Classes Christian Schumacher, chschuma@inf.ethz.ch Info1 D-MAVT 2013 Object-Oriented Programming Defining and using classes Constructors & destructors Operators friend, this, const Example Student management

More information

Chapter 10 Introduction to Classes

Chapter 10 Introduction to Classes C++ for Engineers and Scientists Third Edition Chapter 10 Introduction to Classes CSc 10200! Introduction to Computing Lecture 20-21 Edgardo Molina Fall 2013 City College of New York 2 Objectives In this

More information

Ch02. True/False Indicate whether the statement is true or false.

Ch02. True/False Indicate whether the statement is true or false. Ch02 True/False Indicate whether the statement is true or false. 1. The base class inherits all its properties from the derived class. 2. Inheritance is an is-a relationship. 3. In single inheritance,

More information

PART A : MULTIPLE CHOICE Circle the letter of the best answer (1 mark each)

PART A : MULTIPLE CHOICE Circle the letter of the best answer (1 mark each) PART A : MULTIPLE CHOICE Circle the letter of the best answer (1 mark each) 1. An example of a narrowing conversion is a) double to long b) long to integer c) float to long d) integer to long 2. The key

More information

public : int min, hour ; T( ) //here constructor is defined inside the class definition, as line function. { sec = min = hour = 0 ; }

public : int min, hour ; T( ) //here constructor is defined inside the class definition, as line function. { sec = min = hour = 0 ; } . CONSTRUCTOR If the name of the member function of a class and the name of class are same, then the member function is called constructor. Constructors are used to initialize the object of that class

More information

Data Abstraction. Hwansoo Han

Data Abstraction. Hwansoo Han Data Abstraction Hwansoo Han Data Abstraction Data abstraction s roots can be found in Simula67 An abstract data type (ADT) is defined In terms of the operations that it supports (i.e., that can be performed

More information

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value Paytm Programming Sample paper: 1) A copy constructor is called a. when an object is returned by value b. when an object is passed by value as an argument c. when compiler generates a temporary object

More information

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017 Overview of OOP Dr. Zhang COSC 1436 Summer, 2017 7/18/2017 Review Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in square brackets: l = [1, 2, "a"] (access by index, is mutable

More information

6.096 Introduction to C++ January (IAP) 2009

6.096 Introduction to C++ January (IAP) 2009 MIT OpenCourseWare http://ocw.mit.edu 6.096 Introduction to C++ January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Welcome to 6.096 Lecture

More information

Introduction Of Classes ( OOPS )

Introduction Of Classes ( OOPS ) Introduction Of Classes ( OOPS ) Classes (I) A class is an expanded concept of a data structure: instead of holding only data, it can hold both data and functions. An object is an instantiation of a class.

More information

C++_ MARKS 40 MIN

C++_ MARKS 40 MIN C++_16.9.2018 40 MARKS 40 MIN https://tinyurl.com/ya62ayzs 1) Declaration of a pointer more than once may cause A. Error B. Abort C. Trap D. Null 2Whice is not a correct variable type in C++? A. float

More information

CS3157: Advanced Programming. Outline

CS3157: Advanced Programming. Outline CS3157: Advanced Programming Lecture #12 Apr 3 Shlomo Hershkop shlomo@cs.columbia.edu 1 Outline Intro CPP Boring stuff: Language basics: identifiers, data types, operators, type conversions, branching

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++ No. of Printed Pages : 3 I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination 05723. June, 2015 BCS-031 : PROGRAMMING IN C ++ Time : 3 hours Maximum Marks : 100 (Weightage 75%)

More information

2 ADT Programming User-defined abstract data types

2 ADT Programming User-defined abstract data types Preview 2 ADT Programming User-defined abstract data types user-defined data types in C++: classes constructors and destructors const accessor functions, and inline functions special initialization construct

More information

Collected By Anonymous

Collected By Anonymous CS201- Introduction to Programming Mega Collection for Final Term Only Solved Paper Year Session Paper # 01 2012 Unknown Paper # 02 2011 (session_02) Paper # 03 2011 (session_03) Paper # 04 2010 Unknown

More information

Padasalai.Net s Model Question Paper

Padasalai.Net s Model Question Paper Padasalai.Net s Model Question Paper STD: XII VOLUME - 2 MARKS: 150 SUB: COMPUTER SCIENCE TIME: 3 HRS PART I Choose the correct answer: 75 X 1 = 75 1. Which of the following is an object oriented programming

More information

Object Oriented Design

Object Oriented Design Object Oriented Design Chapter 9 Initializing a non-static data member in the class definition is a syntax error 1 9.2 Time Class Case Study In Fig. 9.1, the class definition is enclosed in the following

More information

Java Object Oriented Design. CSC207 Fall 2014

Java Object Oriented Design. CSC207 Fall 2014 Java Object Oriented Design CSC207 Fall 2014 Design Problem Design an application where the user can draw different shapes Lines Circles Rectangles Just high level design, don t write any detailed code

More information

Abstraction in Software Development

Abstraction in Software Development Abstract Data Types Programmer-created data types that specify values that can be stored (type of data) operations that can be done on the values The user of an abstract data type (ADT) does not need to

More information

Compositional C++ Page 1 of 17

Compositional C++ Page 1 of 17 Compositional C++ Page 1 of 17 Compositional C++ is a small set of extensions to C++ for parallel programming. OVERVIEW OF C++ With a few exceptions, C++ is a pure extension of ANSI C. Its features: Strong

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING CS6456 OBJECT ORIENTED PROGRAMMING

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING CS6456 OBJECT ORIENTED PROGRAMMING DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING CS6456 OBJECT ORIENTED PROGRAMMING Unit I : OVERVIEW PART A (2 Marks) 1. Give some characteristics of procedure-oriented

More information

Abstract Data Types (ADTs) 1. Legal Values. Client Code for Rational ADT. ADT Design. CS 247: Software Engineering Principles

Abstract Data Types (ADTs) 1. Legal Values. Client Code for Rational ADT. ADT Design. CS 247: Software Engineering Principles Abstract Data Types (ADTs) CS 247: Software Engineering Principles ADT Design An abstract data type (ADT) is a user-defined type that bundles together: the range of values that variables of that type can

More information

Object-Oriented Programming

Object-Oriented Programming Object-Oriented Programming 1. What is object-oriented programming (OOP)? OOP is a technique to develop logical modules, such as classes that contain properties, methods, fields, and events. An object

More information

Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team

Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team Question No: 1 ( Marks: 2 ) Write a declaration statement for an array of 10

More information

CS201 Some Important Definitions

CS201 Some Important Definitions CS201 Some Important Definitions For Viva Preparation 1. What is a program? A program is a precise sequence of steps to solve a particular problem. 2. What is a class? We write a C++ program using data

More information

Week 8: Operator overloading

Week 8: Operator overloading Due to various disruptions, we did not get through all the material in the slides below. CS319: Scientific Computing (with C++) Week 8: Operator overloading 1 The copy constructor 2 Operator Overloading

More information

G52CPP C++ Programming Lecture 13

G52CPP C++ Programming Lecture 13 G52CPP C++ Programming Lecture 13 Dr Jason Atkin http://www.cs.nott.ac.uk/~jaa/cpp/ g52cpp.html 1 Last lecture Function pointers Arrays of function pointers Virtual and non-virtual functions vtable and

More information

CS 247: Software Engineering Principles. ADT Design

CS 247: Software Engineering Principles. ADT Design CS 247: Software Engineering Principles ADT Design Readings: Eckel, Vol. 1 Ch. 7 Function Overloading & Default Arguments Ch. 12 Operator Overloading U Waterloo CS247 (Spring 2017) p.1/17 Abstract Data

More information

Example : class Student { int rollno; float marks; public: student( ) //Constructor { rollno=0; marks=0.0; } //other public members };

Example : class Student { int rollno; float marks; public: student( ) //Constructor { rollno=0; marks=0.0; } //other public members }; Constructors A Member function with the same name as its classis called Constructor and it is used to initilize the objects of that class type with a legal value. A Constructor is a special member function

More information

Distributed Real-Time Control Systems. Lecture 14 Intro to C++ Part III

Distributed Real-Time Control Systems. Lecture 14 Intro to C++ Part III Distributed Real-Time Control Systems Lecture 14 Intro to C++ Part III 1 Class Hierarchies The human brain is very efficient in finding common properties to different entities and classify them according

More information

CMPT 117: Tutorial 1. Craig Thompson. 12 January 2009

CMPT 117: Tutorial 1. Craig Thompson. 12 January 2009 CMPT 117: Tutorial 1 Craig Thompson 12 January 2009 Administrivia Coding habits OOP Header Files Function Overloading Class info Tutorials Review of course material additional examples Q&A Labs Work on

More information

Introduction to Programming session 24

Introduction to Programming session 24 Introduction to Programming session 24 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2010 These slides are created using Deitel sslides Sharif Universityof Technology Outlines Introduction

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

MaanavaN.Com CS1203 OBJECT ORIENTED PROGRAMMING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

MaanavaN.Com CS1203 OBJECT ORIENTED PROGRAMMING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING SUB CODE / SUBJECT: CS1203 / Object oriented programming YEAR / SEM: II / III QUESTION BANK UNIT I FUNDAMENTALS PART-A (2 MARKS) 1. What is Object Oriented

More information