VU Mobile Powered by S NO Group All Rights Reserved S NO Group 2012

Size: px
Start display at page:

Download "VU Mobile Powered by S NO Group All Rights Reserved S NO Group 2012"

Transcription

1 1 CS304 Final Term Solved MCQs Mega File (Latest All in One) User can make virtual table explicitly. True False In order to define a class template the first line of definition must be: template <typename T> typename <template T> Template Class <ClassName> Class <Template T> Consider the following statements: 1) int iarray[5]; 2) int *parr = iarray; These statements will compile successfully Error in first statement Error in second statement None of given options In c++ dynamic binding and polymorphism will be achieved when member function will be. virtual inline In type in depended function template should be use where code and behavior must be identical. True False Consider the code below, class class1{ protected: int i; }; class class2 : class1 { }; Then int member i of class1 is in class2, protected none of the given options In specialization we can, Replace child class with its base class Replace base class with its child class (Not Sure) Replace both child and base classes interchangeably None of the given options Consider the code below, class class1{ : void func1(); }; class class2 : class1 { }; Function func1 of class1 is in class2, protected none of the given options It is illegal to make objects of one class members of another class. True False An abstract class is useful when no classes should be derived from it. there are multiple paths from one derived class to another.

2 2 no objects should be instantiated from its. you want to defer the declaration of the class. In resolution order compiler search firstly. Generic Template Partial Specialization Complete Specialization Ordinary function template<> class Vector{ void** p; //... void*& operator[] ((int i); }; This specialization can then be used as the common implementation for all Vectors of pointers. This specialization can then be used as the all type implementation for one type classes. This specialization can then be used double type pointers. This specialization should be used for Vectors of all type int types. In inheritance derived class pointer can be assigned to base class pointer in. Main function In derived class member and friend functions In base class member and friend functions None of the given options Which statement will be true for concrete class? it implements an virtual concept. it can be instantiated it cannot be instantiated none of given The Specialization pattern after the name says that this specialization is to be used for every. data types meta types virtual types pointers type c++ dynamic binding and polymorphism will be achieved when member function will be. virtual inline Consider the code below, class class1{ protected: void func1(); }; class class2 : class1 { }; Function func1 of class1 is in class2, protected none of the given options Consider the code below, class class1{ protected: int i; }; class class2 : protected class1 { }; Then int member i of class1 is in class2, protected none of the given options Consider the code below, class class1{ : void func1(); }; class class2 : class1 { }; Function func1 of class1 is in class2,

3 3 protected none of the given options Consider the following statements: 1) int iarray[5]; 2) int *parr = iarray; These statements will compile successfully Error in first statement Error in second statement None of given options Consider the code below, class class1{ : int i; }; class class2 : class1 { }; Then int member i of class1 is in class2, protected none of the given options If there is a pointer, p, to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a virtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the class to be executed. base derived virtual implemented Derived class can inherit from base class as well as and protected base classes True False Two functions with same names, parameters and return type can exist in, Function overloading Function overriding Operator overloading None of these options Consider the code below, class class1{ : int i; }; class class2 : class1 { }; Then int member i of class1 is in class2, protected none of the given options Target of a function call is determined at run time. instance virtual operator none of given A function call is resolved at run-time in non-virtual member function virtual member function Both non-virtual member and virtual member function. None of given

4 4 Consider the code below, class class1{ : int i; }; class class2 : class1 { }; Then int member i of class1 is in class2, protected none of the given options Consider the code below, class c1{ }; class c2 : c1 { }; class c3 : c2 { }; Then c1 is, Direct base class of c3 Direct child class of c3 Direct base class of c2 Direct child class of c2 A class can inherit from more then one class is called. Simple inheritance Multiple inheritances Single inheritance Double inheritance template<> class Vector{ void** p; //... void*& operator[] ((int i); }; This specialization can then be used as the common implimentation for all Vectors of pointers. This spcialization can then be used as the all type implimentation for one type classes. This specialization can then be used double type pointers. This specialization should be used for Vectors of all type int types. Consider the code below, class class1{ : int i; }; class class2 : protected class1 { }; Then int member i of class1 is in class2, protected none of the given options Consider the code below, class class1{ : void func1(); }; class class2 : class1 { }; Function func1 of class1 is in class2, protected none of the given options Templates automatically create different versions of a function, depending on user input. True False Binding means that target function for a call is selected at run time Automatic Dynamic Static Dramatic When we create objects, then space is allocated to: Member function Access specifier Data member None of given

5 5 There is only one form of copy constructor. True False Which of the following features of OOP is used to deal with only relevant details? Abstraction Information hiding Object Binding means that targets function for a call is selected at compile time. Static Dynamic Automatic None of given In C++, we declare a function virtual by preceding the function header with keyword Inline. True False It is illegal to make objects of one class members of another class. True False In Resolution order compiler search firstly. Generic Template Partial Specification Complete Specification Ordinary function Derived class can inherit from base class as well as and protected base classes True False Which line will produce error. Class phone: Private Transmit, Receiver { } 1.int main () 2. { 3.phone obj; 4.Tranmit*obj1 = &obj; 5.Received obj2 = &obj; 6.} 3 rd line will produce error 4th line will produce error 3 rd and 4 th line will produce error. 5 th line will produce error. Methodologies to the development of reusable software relate to. Structure programming Procedural programming Generic programming None of the given A template argument is preceded by the keyword. Vector Class Template Type* Friends are used exactly the same for template and non-template classes. True False

6 6 A function template must have a parameter True False Child class can call constructor of its, Direct base class Indirect base class Both direct and indirect base classes None of these. Which statement will be true for concrete class? It implements an virtual concept. It can be instantiated It cannot be instantiated None of given A class D can be derived from a class C, which is derived froma class B, which is derived from a class A True False Adding a derived class to a base class requires fundamental changes to the base class. True False A Class or class template can have member that are themselves templates. Variable Function Objects None of given Which will be the Primary task or tasks of generic programming? Categorize the abstractions in a domain into concepts Implement generic algorithms based on the concepts Build concrete models of the concepts All of given The default inheritance mode is, Public inheritance Protected Inheritance Private Inheritance None of these options If there is a pointer, p, to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a virtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the class to be executed. Base Derived Virtual Implemented Child class can call constructor of its, Direct base class Indirect base class

7 7 Both direct and indirect base classes None of these A pure virtual function is a virtual function that causes its class to be abstract. returns nothing. is used in a derived class. takes no arguments. Two functions with same names, parameters and return type can exist in, Function overloading Function overriding Operator overloading None of these options Adding a derived class to a base class requires fundamental changes to the base class. True FALSE User can make virtual table explicitly. TRUE False Consider the following statements: 1) int iarray[5]; 2) int *parr = iarray; These statements will compile successfully Error in first statement Error in second statement None of given options Consider the code below, class class1{ : void func1(); }; class class2 : protected class1 { }; Function func1 of class1 is in class2, protected none of the given options Consider the code below, class c1{ }; class c2 : c1 { }; class c3 : c2 { }; Then c2 is, Direct base class of c3 Direct child class of c3 Direct base class of c1 None of these Class is not a mechanism to create objects and define user data types. true false Memory is allocated to non static members only, when: 1. Class is created 2. Object is defined 3. Object is initialized 4. Object is created The sub-object s life is not dependent on the life of master class in. 1. Composition 2. Aggregation

8 8 3. Separation 4. non of the given Unary operators and assignment operator are right associative. 1. true 2. false The >= operator can't be overloaded. 1. true 2. false is creating objects of one class inside another class. 1. Association 2. Composition 3. Aggregation 4. Inheritance If we are create array of objects through new operator, then 1. We can call overloaded constructor through new 2. We can t call overloaded constructor through new 3. We can call default constructor through new 4. None of the given Object can be declared constant with the use of Constant keyword. 1. true 2. false Operator will take only one operand. 1. New 2. int 3. object 4. none of the given Which of the following operator(s) take(s) one or no argument if overloaded? * 3. % 4. All of the given choices this pointer does not pass implicitly to functions. 1. Static Member 2. Non-Static Member 3. Instance Number 4. None of the given Operator overloading is 1. making C++ operators work with objects. 2. giving C++ operators more than they can handle. 3. giving new meanings to existing Class members. 4. making new C++ operators Question # 1 of 10 Information hiding can be achieved through. 1. Encapsulation, Inheritance 2. Encapsulation, Polymorphism 3. Encapsulation, Abstraction 4. Overloading Question # 2 of 10 ( Start time: 01:11:21 AM ) Total M a r k s: 1 A good model is... related to a real life problem. 1. Loosely 2. Openly

9 9 3. Closely Question # 3 of 10 ( Start time: 01:12:33 AM ) Total M a r k s: 1 Which of the following features of OOP is used to derive a class from another? 1. Encapsulation 2. Polymorphism 3. Data hiding 4. Inheritance Question # 4 of 10 ( Start time: 01:13:51 AM ) Total M a r k s: 1 Which of the following is a weak relationship between two objects? 1. Inheritance 2. Composition 3. Aggregation 4. None of given Question # 5 of 10 ( Start time: 01:14:56 AM ) Total M a r k s: 1 Data items in a class must be. 1. True 2. False Question # 6 of 10 ( Start time: 01:15:52 AM ) Total M a r k s: 1 Which one is a class association 1. Simple Association 2. Inheritance 3. Composition 4. Aggregation Question # 7 of 10 ( Start time: 01:16:55 AM ) Total M a r k s: 1 Suppose there is an object of type Person, which of the following can be considered as one of its attributes 1. Name 2. Age 3. Work() 4. Both Name and Age Question # 8 of 10 ( Start time: 01:17:52 AM ) Total M a r k s: 1 Which one is not an object association? 1. Simple association 2. Inheritance 3. Aggregation 4. Association Question # 9 of 10 ( Start time: 01:18:50 AM ) Total M a r k s: 1 Using encapsulation we can achieve 1. Information hiding 2. Least interdependencies among modules 3. Implementation independence 4. All of given options Question # 10 of 10 ( Start time: 01:19:43 AM ) Total M a r k s: 1 In constant member function the type of this pointer is: 1. Constant pointer 2. Constant pointer to object 3. Constant pointer to class 4. Constant pointer to constant object Question # 1 of 10

10 10 Which of the following is the way to extract common behavior and attributes from the given classes and make a separate class of those common behaviors and attributes? 1. Generalization 2. Sub-typing 3. Specialization 4. Extension Question # 2 of 10 The ability to derive a class from more than one class is called 1. Single inheritance 2. Encapsulation 3. Multiple inheritance 4. Polymorphism Question # 3 of 10: If MyClass has a destructor what is the destructor named? 1. MyClass 2. ~MyClass 3. My~Class 4. MyClass~ Question # 4 of 10: Class abc{ }; Is a valid class declaration? 1. yes 2. no Question # 5of 10: Without using Deep copy constructor, A problem can occur 1. System crash 2. Memory Leakage 3. Dangling pointer 4. All of the given Question # 6 of 10: If only one behaviour of a derived class is incompatible with base class, then it is: 1. Generalization 2. Specialization 3. Extension 4. Inheritance Question # 7 of 10: Which of the following may not be an integral part of an object? 1. state 2. behavior 3. Protected data members 4. All of given Question # 8 of 10: Only tangible things can be chosen as an object. 1. True 2. False A class hierarchy shows the same relationships as an organization chart. describes has a relationships. describes is a kind of relationships. shows the same relationships as a family tree. Sender of the message does not need to know the exact class of receiver in.

11 11 Abstraction Polymorphism Inheritance none of the given A function call is resolved at run-time in non-virtual member function virtual member function Both non-virtual member and virtual member function. None of given Adding a derived class to a base class requires fundamental changes to the base class. True False User can make virtual table explicitly. True False Binding means that target function for a call is selected at compile time. Static Dynamic Automatic None of given Which line will produce error. Class phone: Transmit, Receiver { } 1. int main() 2. { 3. phone obj; 4. Tranmit* obj1 = &obj; 5. Received obj2 = &obj; 6. } 3rd line will produce error 4th line will produce error 3rd and 4th line will produce error. 5th line will produce error Function overriding is done in context of, Single class Single derived class Single base class Derived and base classes the following statements: 1) int iarray[5]; 2) int *parr = iarray; These statements will compile successfully Error in first statement Error in second statement None of given options Methodologies to the development of reusable software relate to. Structure programming procedural programming

12 12 generic programming None of the given Virtual functions allow you to create an array of type pointer-to-base class that can hold pointers to derived classes. create functions that can never be accessed. group objects of different classes so they can all be accessed by the same function code. use the same function call to execute member functions of objects from different classes. User can make virtual table explicitly. True False In order to define a class template the first line of definition must be: template <typename T> typename <template T> Template Class <ClassName> Class <Template T> Consider the following statements: 1) int iarray[5]; 2) int *parr = iarray; These statements will compile successfully Error in first statement Error in second statement None of given options In c++ dynamic binding and polymorphism will be achieved when member function will be. virtual inline In type in depended function template should be use where code and behavior must be identical. True False Consider the code below, class class1{ protected: int i; }; class class2 : class1 { }; Then int member i of class1 is in class2, protected none of the given options In specialization we can, Replace child class with its base class Replace base class with its child class (Not Sure) Replace both child and base classes interchangeably None of the given options

13 13 Consider the code below, class class1{ : void func1(); }; class class2 : class1 { }; Function func1 of class1 is in class2, protected none of the given options It is illegal to make objects of one class members of another class. True False An abstract class is useful when no classes should be derived from it. there are multiple paths from one derived class to another. no objects should be instantiated from its. you want to defer the declaration of the class. In resolution order compiler search firstly. Generic Template Partial Specialization Complete Specialization Ordinary function template<> class Vector{ void** p; //... void*& operator[] ((int i); }; This specialization can then be used as the common implimentation for all Vectors of pointers. This spcialization can then be used as the all type implimentation for one type classes. This specialization can then be used double type pointers. This specialization should be used for Vectors of all type int types. In inheritance derived class pointer can be assigned to base class pointer in, Main function In derived class member and friend functions In base class member and friend functions None of the given options Which statement will be true for concrete class? it implements an virtual concept. it can be instantiated it cannot be instantiated none of given The Specialization pattern after the name says that this specialization is to be used for every. data types meta types virtual types pointers type

14 14 c++ dynamic binding and polymorphism will be achieved when member function will be. virtual inline Consider the code below, class class1{ protected: void func1(); }; class class2 : class1 { }; Function func1 of class1 is in class2, protected none of the given options Consider the code below, class class1{ protected: int i; }; class class2 : protected class1 { }; Then int member i of class1 is in class2, protected none of the given options Consider the code below, class class1{ : void func1(); }; class class2 : class1 { }; Function func1 of class1 is in class2, protected none of the given options Consider the following statements: 1) int iarray[5]; 2) int *parr = iarray; These statements will compile successfully Error in first statement Error in second statement None of given options Consider the code below, class class1{ : int i; }; class class2 : class1 { }; Then int member i of class1 is in class2, protected none of the given options If there is a pointer, p, to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a virtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the class to be executed. base derived virtual implemented Derived class can inherit from base class as well as and protected base classes

15 15 True False Two functions with same names, parameters and return type can exist in, Function overloading Function overriding Operator overloading None of these options Consider the code below, class class1{ : int i; }; class class2 : class1 { }; Then int member i of class1 is in class2, protected none of the given options A function call is resolved at run-time in non-virtual member function virtual member function Both non-virtual member and virtual member function. None of given Question No: 1 ( Marks: 1 ) - Please choose one Which of the following causes run time binding? Declaring object of abstract class Declaring pointer of abstract class Declaring overridden methods as non-virtual None of the given Question No: 2 ( Marks: 1 ) - Please choose one Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types? Templates Overloading Data hiding Encapsulation Question No: 3 ( Marks: 1 ) - Please choose one A copy constructor is invoked when a function do not returns by value. an argument is passed by value. a function returns by reference. an argument is passed by reference. Question No: 4 ( Marks: 1 ) - Please choose one Like template functions, a class template may not handle all the types successfully. True False Question No: 6 ( Marks: 1 ) - Please choose one A class template may inherit from another class template. True False Question No: 7 ( Marks: 1 ) - Please choose one By default the vector data items are initialized to 0 0.0

16 16 1 null Question No: 8 ( Marks: 1 ) - Please choose one In Private only member functions and friend classes or functions of a derived class can convert pointer or reference of derived object to that of parent object specialization inheritance abstraction composition Question No: 9 ( Marks: 1 ) - Please choose one Which of the following is/are advantage[s] of generic programming? Reusability Writability Maintainability All of given Question No: 10 ( Marks: 1 ) - Please choose one Template functions use than ordinary functions. Greater Memory Lesser Memory Equal Memory None of the given options Question No: 11 ( Marks: 1 ) - Please choose one Non Template Friend functions of a class are friends of instance/s of that class. All One specific All instances of one date type None of the given options Question No: 12 ( Marks: 1 ) - Please choose one A copy constructor is invoked when a function do not returns by value. an argument is passed by value. a function returns by reference. an argument is passed by reference. Question No: 13 ( Marks: 1 ) - Please choose one A pointer to a base class can point to objects of a derived class. True False Question No: 14 ( Marks: 1 ) - Please choose one A template argument is preceded by the keyword. vector class template type* Question No: 15 ( Marks: 1 ) - Please choose one Which one of the following terms must relate to polymorphism? Static allocation Static typing Dynamic binding Dynamic allocation Question No: 16 ( Marks: 1 ) - Please choose one Multiple inheritance can be of type

17 17 Public Private Protected All of the given Question No: 17 ( Marks: 1 ) - Please choose one Assume a class Derv that is ly derived from class Base. An object of class Derv located in main() can access members of Derv. protected members of Derv. members of Derv. protected members of Base. Question No: 18 ( Marks: 1 ) - Please choose one A copy constructor is invoked when a function do not returns by value. an argument is passed by value. a function returns by reference. an argument is passed by reference. Question No: 19 ( Marks: 1 ) - Please choose one A function call is resolved at run-time in non-virtual member function. virtual member function. Both non-virtual member and virtual member function. None of given Question No: 20 ( Marks: 1 ) - Please choose one Two important STL associative containers are and. set,map sequence,mapping setmet,multipule sit,mat Question No: 21 ( Marks: 1 ) An abstract class is useful when, - Please choose one We do not derive any class from it. There are multiple paths from one derived class to another. We do not want to instantiate its object. You want to defer the declaration of the class. Question No: 22 ( Marks: 1 ) - Please choose one Which of the following is/are advantage[s] of generic programming? Reusability Writability Maintainability All of given Question No: 23 ( Marks: 1 ) - Please choose one By default the vector data items are initialized to null Question No: 24 ( Marks: 1 ) - Please choose one Suppose you create an uninitialized vector as follows: vector<int> evec; After adding the statment, evec.push_back(21); what will happen?

18 18 The following statement will add an element to the start (the back) of evec and will initialize it with the value 21. The following statement will add an element to the center of evec and will reinitialize it with the value 21. The following statement will delete an element to the end (the back) of evec and will reinitialize it with the value 21. The following statement will add an element to the end (the back) of evec and initialize it with the value 21. Question No: 25 ( Marks: 1 ) - Please choose one Default constructor is such constructor which either has no or if it has some parameters these have values Parameter, temporary Null, Parameter Parameter, default non of the given Question No: 28 ( Marks: 1 ) Classes like TwoDimensionalShape and ThreeDimensionalShape would normally be concrete, while classes like Sphere and Cube would normally be abstract. True False Question No: 29 ( Marks: 1 ) In order to define a class template, the first line of definition must be: template <typename T> typename <template T> Template Class <ClassName> Class <Template T> Question No: 30 ( Marks: 1 ) In case of multiple inheritance a derived class inherits, Only the member functions of its base classes Only the data members of its base classes Both data members and member functions of all its base classes Data members and member functions of any two base classes Question No: 1 ( Marks: 1 ) - Please choose one A template provides a convenient way to make a family of variables and data members functions and classes classes and exceptions programs and algorithms Question No: 2 ( Marks: 1 ) - Please choose one Which one of the following terms must relate to polymorphism? Static allocation Static typing Dynamic binding Dynamic allocation Question No: 3 ( Marks: 1 ) - Please choose one What is true about function templates? The compiler generates only one copy of the function template The compiler generates a copy of function respective to each type of data The compiler can only generate copy for the int type data None of the given. Question No: 5 ( Marks: 1 ) - Please choose one template <> class Vector<char*> { } This is an example of partial specialization. True

19 19 False Question No: 7 ( Marks: 1 ) - Please choose one A non-virtual member function is defined in a base class and overridden in a derived class; if that function is called through a base-class pointer to a derived class object, the derived-class version is used. True False Question No: 8 ( Marks: 1 ) - Please choose one Assume a class Derv that is ly derived from class Base. An object of class Derv located in main() can access members of Derv. protected members of Derv. members of Derv. protected members of Base. Question No: 9 ( Marks: 1 ) - Please choose one In order to define a class template, the first line of definition must be: template <typename T> typename <template T> Template Class <ClassName> Class <Template T> Question No: 10 ( Marks: 1 ) - Please choose one If there is a pointer p to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a nonvirtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the class to be executed. Base Derived Abstract virtual Question No: 11 ( Marks: 1 ) - Please choose one When the base class and the derived class have a member function with the same name, you must be more specific which function you want to call (using ). scope resolution operator dot operator null operator Operator overloading Question No: 12 ( Marks: 1 ) - Please choose one Non Template Friend functions of a class are friends of instance/s of that class. All One specific All instances of one date type None of the given options Question No: 13 ( Marks: 1 ) The find() algorithm - Please choose one finds matching sequences of elements in two containers. finds a container that matches a specified container. takes iterators as its first two arguments. takes container elements as its first two arguments. Question No: 14 ( Marks: 1 ) - Please choose one

20 20 If you define a vector v with the default constructor, and define another vector w with a one -argument constructor to a size of 11, and insert 3 elements into each of these vectors with push_back(), then the size() member function will return for v and for w. 11 for v and 3 for w. 0 for v and 0 for w. 0 for v and 3 for w. 3 for v and 11 for w. (100% Sure) Question No: 15 ( Marks: 1 ) - Please choose one Which of the following may not be an integral part of an object? State Behavior Protected data members All of given Question No: 16 ( Marks: 1 ) - Please choose one Which is not the Advantage of inheritance? providing class growth through natural selection. facilitating class libraries. avoiding the rewriting of code. providing a useful conceptual framework. Question No: 17 ( Marks: 1 ) - Please choose one class DocElement { : virtual void Print() { cout << "Generic element"; } }; class Heading : DocElement { : void Print() { cout << "Heading element"; } }; class Paragraph : DocElement { : void Print() { cout << "Paragraph element"; } }; void main() { DocElement * p = new Paragraph(); } p->print(); When you run this program, it will print out a single line to the console output. What will be in that line? Select one correct answer from the following list: Generic element Heading element Paragraph element Nothing will be printed. Question No: 18 ( Marks: 1 ) - Please choose one When a virtual function is called by referencing a specific object by name and using the dot member selection operator (e.g., squareobject.draw()), the reference is resolved at compile time. True False Question No: 19 ( Marks: 1 ) - Please choose one In case of multiple inheritance a derived class inherits,

21 21 Only the member functions of its base classes Only the data members of its base classes Both data members and member functions of all its base classes Data members and member functions of any two base classes Question No: 20 ( Marks: 1 ) - Please choose one When we write a class template the first line must be: template < class class_name> template < class data_type> template < class T > Here T can be replaced with any name but it is preferable. class class-name() class template<class_name> Question No: 21 ( Marks: 1 ) - Please choose one Which of the following is incorrect line regarding function template? template<class T> template <typename U> Class<template T> template < class T, class U> Question No: 22 ( Marks: 1 ) - Please choose one An STL container can not be used to, hold objects of class employee. store elements in a way that makes them quickly accessible. compile c++ programs. organize the way objects are stored in memory Question No: 23 ( Marks: 1 ) - Please choose one Algorithms can only be implemented using STL containers. True False Question No: 24 ( Marks: 1 ) - Please choose one Consider a class named Vehicle, which of the following can be the instance of class Vehicle? 1. Car 2. Computer 3. Desk 4. Ahmed 5. Bicycle 6. Truck 1, 4, 5 2, 5, 6 1, 2, 3, 6 1, 5, 6 Question No: 25 ( Marks: 1 ) Consider the code below, class Fred { : Fred();... }; int main() { Fred a[10]; Fred* p = new Fred[10];... } Select the best option, - Please choose one

22 22 Fred a[10]; calls the default constructor 09 times Fred* p = new Fred[10]; calls the default constructor 10 times Produce an error Fred a[10]; calls the default constructor 11 times Fred* p = new Fred[10]; calls the default constructor 11 times Fred a[10]; calls the default constructor 10 times Fred* p = new Fred[10]; calls the default constructor 10 times Question No: 26 ( Marks: 1 ) - Please choose one When a variable is define as static in a class then all object of this class, Have different copies of this variable Have same copy of this variable Can not access this variable None of given Question No: 27 ( Marks: 1 ) - Please choose one The life of sub object is dependant on the life of master class in. Separation Composition Aggregation None of the given Question No: 28 ( Marks: 1 ) - Please choose one, which means if A declares B as its friend it does NOT mean that A can access data of B. It only means that B can access all data of A. Friendship is one way only Friendship is two way only NO Friendship between classes Any kind of friendship Question No: 29 ( Marks: 1 ) - Please choose one Which of the following operators always takes no argument if overloaded? / FINALTERM EXAMINATION Spring 2010 CS304- Object Oriented Programming Question No: 1 ( Marks: 1 ) - Please choose one A template argument is preceded by the keyword. vector class template type* Ref No: Time: 90 min Marks: 58 Question No: 2 ( Marks: 1 ) - Please choose one Which of the following causes run time binding? Declaring object of abstract class Declaring pointer of abstract class Declaring overridden methods as non-virtual None of the given Question No: 3 ( Marks: 1 ) - Please choose one A function template can not be overloaded by another function template. True False

23 23 Question No: 4 ( Marks: 1 ) - Please choose one Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types? Templates Overloading Data hiding Encapsulation Question No: 5 ( Marks: 1 ) - Please choose one Identify the correct way of declaring an object of user defined template class A for char type members? A< char > obj; <char>a obj; A obj<char>; Obj <char> A; Question No: 6 ( Marks: 1 ) - Please choose one The user must define the operation of the copy constructor. True False Question No: 7 ( Marks: 1 ) - Please choose one Template functions use than ordinary functions. Greater Memory Lesser Memory Equal Memory None of the given options Question No: 8 ( Marks: 1 ) - Please choose one The find() algorithm finds matching sequences of elements in two containers. finds a container that matches a specified container. takes iterators as its first two arguments. takes container elements as its first two arguments. Question No: 9 ( Marks: 1 ) - Please choose one Compiler performs type checking to diagnose type errors, Static Dynamic Bound Unbound Question No: 10 ( Marks: 1 ) - Please choose one Which of the following is/are advantage[s] of generic programming? Reusability Writability Maintainability All of given Question No: 11 ( Marks: 1 ) - Please choose one Vectors contain contiguous elements stored as a[an]. variable array function datatype Question No: 12 ( Marks: 1 ) - Please choose one Suppose you create an uninitialized vector as follows: vector<int> evec; After adding the statment, evec.push_back(21); what will happen? The following statement will add an element to the start (the back) of evec and will initialize it with the value 21. The following statement will add an element to the center of evec and will reinitialize it with the value 21.

24 24 The following statement will delete an element to the end (the back) of evec and wil l reinitialize it with the value 21. The following statement will add an element to the end (the back) of evec and initialize it with the value 21. Question No: 13 ( Marks: 1 ) - Please choose one In a de-queue, (chose the best option) data can be quickly inserted or deleted at any arbitrary location. data can be inserted or deleted at any arbitrary location, but the process is relatively slow. data can not be quickly inserted or deleted at either end. data can be inserted or deleted at either end, but the process is relatively slow. Question No: 14 ( Marks: 1 ) - Please choose one Algorithms can only be implemented using STL containers. True False Question No: 15 ( Marks: 1 ) - Please choose one 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. Question No: 16 ( Marks: 1 ) - Please choose one Inheritance is a way to organize data. pass arguments to objects of classes. add features to existing classes without rewriting them. improve data-hiding and encapsulation. Question No: 17 ( Marks: 1 ) - Please choose one We can use "this" pointer in the constructor in the body and even in the initialization list of any class if we are careful, True False Question No: 18 ( Marks: 1 ) - Please choose one and methods may not be declared abstract.,static, static, none of given Question No: 19 ( Marks: 1 ) - Please choose one Default constructor is such constructor which either has no or if it has some parameters these have values Parameter, temporary Null, Parameter Parameter, default non of the given Question No: 20 ( Marks: 1 ) - Please choose one Public methods of base class can be accessed in its derived class directly inderectly simultaniously non of the given Question No: 21 ( Marks: 1 ) - Please choose one The type that is used to declare a reference or pointer is called its default type

25 25 static type abstract type reference type Question No: 22 ( Marks: 1 ) - Please choose one members are somewhere between and members. They are used in inheritance protected global Question No: 23 ( Marks: 1 ) - Please choose one Which of these are examples of error handling techniques? Abnormal Termination Graceful Termination Return the illegal all of the given Question No: 24 ( Marks: 1 ) - Please choose one follow try block to catch the object thrown catch block throw block main block non of the given Question No: 25 ( Marks: 1 ) - Please choose one Graphical representation of the classes and objects is called object model it shows Class Name only Class Name and attributes Relationships of the objects and classes all of the given Question No: 26 ( Marks: 1 ) - Please choose one Destructor can be overloaded True False OBJECT ORIENTED PROGRAMMING TYPICAL QUESTIONS & ANSWERS OBJECTIVE TYPE QUESTIONS Choose correct or the best alternative in the following: Q.1 The address of a variable temp of type float is (A) *temp (B) &temp (C) float& temp (D) float temp& Ans: B Q.2 What is the output of the following code char symbol[3]={ a, b, c }; for (int index=0; index<3; index++) cout << symbol [index];

26 26 (A) a b c (B) abc (C) abc (D) abc Ans: C Q.3 The process of building new classes from existing one is called. (A) Polymorphism (B) Structure (C) Inheritance (D) Cascading Ans: C Q.4 If a class C is derived from class B, which is derived from class A, all through inheritance, then a class C member function can access (A) protected and data only in C and B. (B) protected and data only in C. (C) data in A and B. (D) protected data in A and B. Ans: D Q.5 If the variable count exceeds 100, a single statement that prints Too many is (A) if (count<100) cout << Too many ; (B) if (count>100) cout >> Too many ; (C) if (count>100) cout << Too many ; (D) None of these. Ans: C Q.6 Usually a pure virtual function (A) has complete function body. (B) will never be called. (C) will be called only to delete an object. (D) is defined only in derived class. Ans: D Q.7 To perform stream I/O with disk files in C++, you should (A) open and close files as in procedural languages. (B) use classes derived from ios. (C) use C language library functions to read and write data. (D) include the IOSTREAM.H header file. Ans: B Q.8 Overloading the function operator (A) requires a class with an overloaded operator. (B) requires a class with an overloaded [ ] operator. (C) allows you to create objects that act syntactically like functions. (D) usually make use of a constructor that takes arguments. Ans: A Q.9 In C++, the range of signed integer type variable is (A) 0 to 216 (B) 2 to (C) 2 to (D) 8 0 to 2 Ans: B Q.10 If x 5, y 2 then x y equals. (where is a bitwise XOR operator)

27 27 (A) (B) (C) (D) Ans: A Q.11 If an array is declared as int a[4] = {3, 0, 1, 2}, then values assigned to a[0] & a[4] will be (A) 3, 2 (B) 0, 2 (C) 3, 0 (D) 0, 4 Ans: C Q.12 Mechanism of deriving a class from another derived class is known as (A) Polymorphism (B) Single Inheritance (C) Multilevel Inheritance (D) Message Passing Ans: C Q.13 RunTime Polymorphism is achieved by (A) friend function (B) virtual function (C) operator overloading (D) function overloading Ans: B Q.14 A function call mechanism that passes arguments to a function by passing a copy of the values of the arguments is (A) call by name (B) call by value (C) call by reference (D) call by value result Ans: B Q.15 In C++, dynamic memory allocation is accomplished with the operator (A) new (B) this (C) malloc( ) (D) delete Ans: A Q.16 If we create a file by ifstream, then the default mode of the file is (A) ios :: out (B) ios :: in (C) ios :: app (D) ios :: binary Ans: B Q.17 A variable defined within a block is visible (A) from the point of definition onward in the program. (B) from the point of definition onward in the function. (C) from the point of definition onward in the block. (D) throughout the function. Ans: C

28 28 Q.18 The break statement causes an exit (A) from the innermost loop only. (B) only from the innermost switch. (C) from all loops & switches. (D) from the innermost loop or switch. Ans: D Q.19 Which of the following cannot be legitimately passed to a function (A) A constant. (B) A variable. (C) A structure. (D) A header file. Ans: D Q.20 A property which is not true for classes is that they (A) are removed from memory when not in use. (B) permit data to be hidden from other classes. (C) bring together all aspects of an entity in one place. (D) Can closely model objects in the real world. Ans: C Q.21 You can read input that consists of multiple lines of text using (A) the normal cout << combination. (B) the cin.get( ) function with one argument. (C) the cin.get( ) function with two arguments. (D) the cin.get( ) function with three arguments. Ans: C Q.22 The keyword friend does not appear in (A) the class allowing access to another class. (B) the class desiring access to another class. (C) the section of a class. (D) the section of a class. Ans: C Q.23 The process of building new classes from existing one is called (A) Structure. (B) Inheritance. (C) Polymorphism. (D) Template. Ans: B Q.24 If you wanted to sort many large objects or structures, it would be most efficient to (A) place them in an array & sort the array. (B) place pointers to them in an array & sort the array. (C) place them in a linked list and sort the linked list. (D) place references to them in an array and sort the array. Ans: C Q.25 Which statement gets affected when i++ is changed to ++i? (A) i = 20; i++; (B) for (i = 0; i<20; i++) { } (C) a = i++; (D) while (i++ = 20) cout <<i; Ans: A Q.26 A friend function to a class, C cannot access

29 29 (A) data members and member functions. (B) data members and member functions. (C) protected data members and member functions. (D) the data members of the derived class of C. Ans: D Q.27 The operator that cannot be overloaded is (A) ++ (B) :: (C) ( ) (D) ~ Ans: B Q.28 A struct is the same as a class except that (A) there are no member functions. (B) all members are. (C) cannot be used in inheritance hierarchy. (D) it does have a this pointer. Ans: C Q.29 Pure virtual functions (A) have to be redefined in the inherited class. (B) cannot have access specification. (C) are mandatory for a virtual class. (D) None of the above. Ans: A Q.30 Additional information sent when an exception is thrown may be placed in (A) the throw keyword. (B) the function that caused the error. (C) the catch block. (D) an object of the exception class. Ans: C Q.31 Use of virtual functions implies (A) overloading. (B) overriding. (C) static binding. (D) dynamic binding. Ans: D Q.32 this pointer (A) implicitly points to an object. (B) can be explicitly used in a class. (C) can be used to return an object. (D) All of the above. Ans: D Q.33 Within a switch statement (A) Continue can be used but Break cannot be used (B) Continue cannot be used but Break can be used (C) Both Continue and Break can be used (D) Neither Continue nor Break can be used Ans:B Q.34 Data members which are static (A) cannot be assigned a value

30 30 (B) can only be used in static functions (C) cannot be defined in a Union (D) can be accessed outside the class Ans:B Q.35 Which of the following is false for cin? (A) It represents standard input. (B) It is an object of istream class. (C) It is a class of which stream is an object. (D) Using cin the data can be read from user s terminal. Ans:C Q.36 It is possible to declare as a friend (A) a member function (B) a global function (C) a class (D) all of the above Ans:D Q.37 In multiple inheritance (A) the base classes must have only default constructors (B) cannot have virtual functions (C) can include virtual classes (D) None of the above. Ans:C Q.38 Declaration of a pointer reserves memory space (A) for the object. (B) for the pointer. (C) both for the object and the pointer. (D) none of these. Ans:B Q.39 for (; ;) (A) means the test which is done using some expression is always true (B) is not valid (C) will loop forever (D) should be written as for( ) Ans:C Q.40 The operator << when overloaded in a class (A) must be a member function (B) must be a non member function (C) can be both (A) & (B) above (D) cannot be overloaded Ans:C Q.41 A virtual class is the same as (A) an abstract class (B) a class with a virtual function (C) a base class (D) none of the above. Ans:D Q.42 Identify the operator that is NOT used with pointers (A) -> (B) & (C) *

31 31 (D) >> Ans:D Q.43 Consider the following statements char *ptr; ptr = hello ; cout << *ptr; What will be printed? (A) first letter (B) entire string (C) it is a syntax error (D) last letter Ans:A Q.44 In which case is it mandatory to provide a destructor in a class? (A) Almost in every class (B) Class for which two or more than two objects will be created (C) Class for which copy constructor is defined (D) Class whose objects will be created dynamically Ans:D Q.45 The members of a class, by default, are (A) (B) protected (C) (D) mandatory to specify Ans:C Q.46 Given a class named Book, which of the following is not a valid constructor? (A) Book ( ) { } (B) Book ( Book b) { } (C) Book ( Book &b) { } (D) Book (char* author, char* title) { } Ans:B Q47 Which of the statements is true in a protected derivation of a derived class from a base class? (A) Private members of the base class become protected members of the derived class (B) Protected members of the base class become members of the derived class (C) Public members of the base class become protected members of the derived class (D) Protected derivation does not affect and protected members of the derived class. Ans:C Q48 Which of the following statements is NOT valid about operator overloading? (A) Only existing operators can be overloaded. (B) Overloaded operator must have at least one operand of its class type. (C) The overloaded operators follow the syntax rules of the original operator. (D) none of the above. Ans:D Q.49 Exception handling is targeted at (A) Run-time error (B) Compile time error (C) Logical error (D) All of the above. Ans:A Q.50 A pointer to the base class can hold address of

32 32 (A) only base class object (B) only derived class object (C) base class object as well as derived class object (D) None of the above Ans:C Q.51 Function templates can accept (A) any type of parameters (B) only one parameter (C) only parameters of the basic type (D) only parameters of the derived type Ans:C Q.52 How many constructors can a class have? (A) 0 (B) 1 (C) 2 (D) any number Ans:D Q.53 The new operator (A) returns a pointer to the variable (B) creates a variable called new (C) obtains memory for a new variable (D) tells how much memory is available Ans:C Q.54 Consider the following statements: int x = 22,y=15; x = (x>y)? (x+y) : (x-y); What will be the value of x after executing these statements? (A) 22 (B) 37 (C) 7 (D) Error. Cannot be executed Ans:B Q.55 An exception is caused by (A) a hardware problem (B) a problem in the operating system (C) a syntax error (D) a run-time error Ans:D Q.56 A template class (A) is designed to be stored in different containers (B) works with different data types (C) generates objects which must be identical (D) generates classes with different numbers of member functions. Ans:B Q.57 Which of the following is the valid class declaration header for the derived class d with base classes b1 and b2? (A) class d : b1, b2 (B) class d : class b1, class b2 (C) class d : b1, b2 (D) class d : b1, b2

33 33 Ans:A Q.58 A library function exit() causes an exit from (A) the loop in which it occurs (B) the block in which it occurs (C) the function in which it occurs (D) the program in which it occurs Ans:D Q.59 RunTime polymorphism is achieved by (A) friend function (B) virtual function (C) operator overloading (D) function overloading Ans:B Q.60 Declaration of a pointer reserves memory space (A) for the object. (B) for the pointer. (C) both for the object and the pointer. (D) none of these. Ans:B Q.61 An array element is accessed using (A) a FIFO approach (B) an index number (C) the operator (D) a member name Ans:B Q.62 If there is a pointer p to object of a base class and it contains the address of an object of a derived class and both classes contain a virtual member function abc(), then the statement p->abc(); will cause the version of abc() in the class to be executed. (A) Base Class (B) Derived class (C) Produces compile time error (D) produces runtime error Ans:B Q.63 A pure virtual function is a virtual function that (A) has no body (B) returns nothing (C) is used in base class (D) both (A) and (C) Ans:D Q.64 A static function (A) should be called when an object is destroyed. (B) is closely connected with and individual object of a class. (C) can be called using the class name and function name. (D) is used when a dummy object must be created. Ans:C Q.65 We can output text to an object of class ostream using the insertion operator<< because

34 34 (A) the ostream class is a stream (B) the insertion operator works with all classes. (C) we are actually outputting to cout. (D) the insertion operator is overloaded in ostream. Ans:D Q.66 The statement f1.write((char*)&obj1, sizeof(obj1)); (A) writes the member function of obj1 to f1. (B) Writes the data in obj1 to f1. (C) Writes the member function and the data of obj1 to f1. (D) Writes the address of obj1 to f1. Ans:B Q.67 To convert from a user defined class to a basic type, you would most likely use. (A) A built-in conversion function. (B) A one-argument constructor. (C) A conversion function that s a member of the class. (D) An overloaded = operator. Ans:C Q.68 Which of the following is not the characteristic of constructor. (A) They should be declared in the section. (B) They do not have return type. (C) They can not be inherited. (D) They can be virtual. Ans:D Q.69 Name the header file to be included for the use of built in function isalnum() (A) string.h (B) process.h (C) ctype.h (D) dos.h Ans:C Q.70 What is the output of given code fragment? int f=1, i=2; while(++i<5) f*=i; cout<<f; (A) 12 (B) 24 (C) 6 (D) 3 Ans:A Q.71 A class defined within another class is: (A) Nested class (B) Inheritance (C) Containership (D) Encapsulation Ans:A Q.72 What will be the values of x, m and n after the execution of the following statements? int x, m, n; m = 10; n = 15; x = ++m + n++;

35 35 (A) x=25, m=10, n=15 (B) x=26, m=11, n=16 (C) x=27, m=11, n=16 (D) x=27, m=10, n=15 Ans:B Q.73 Which of the following will produce a value 10 if x = 9.7? (A) floor(x) (B) abs(x) (C) log(x) (D) ceil(x) Ans:D Q74 The major goal of inheritance in c++ is: (A) To facilitate the conversion of data types. (B) To help modular programming. (C) To extend the capabilities of a class. (D) To hide the details of base class. Ans:C Q.75 Consider the following class definitions: class a { }; class b: protected a { }; What happens when we try to compile this class? (A) Will not compile because class body of a is not defined. (B) Will not compile because class body of b is not defined. (C) Will not compile because class a is not inherited. (D) Will compile successfully. Ans:D Q.76 Which of the following expressions is illegal? (A) (B) (false && true) (C) bool (x) = (bool)10; (D) float y = 12.67; Ans:C Q.77 The actual source code for implementing a template function is created when (A) The declaration of function appears. (B) The function is invoked. (C) The definition of the function appears. (D) None of the above. Ans:B Q.78 An exception is caused by (A) a runtime error. (B) a syntax error. (C) a problem in the operating system. (D)a hardware problem. Ans:A Q.79 Which of the following statements are true in c++? (A) Classes can not have data as members. (B) Structures can not have functions as members. (C) Class members are by default.

36 36 (D)None of these. Ans:B Q.80 What would be the output of the following program? int main() { int x,y=10,z=10; x = (y = =z); cout<<x; return 0; } (A) 1 (B) 0 (C) 10 (D) Error Ans:A Q.81 What is the error in the following code? class t { virtual void print(); } (A) No error. (B) Function print() should be declared as static. (C) Function print() should be defined. (D) Class t should contain data members. Ans:A Q.82 What will be the output of following program? #include<iostream.h> void main() { float x; x=(float)9/2; cout<<x; } (A) 4.5 (B) 4.0 (C) 4 (D) 5 Ans:A Q.83 A white space is : (A) blank space (B) new line (C) tab (D) all of the above Ans:D Q.84 The following can be declared as friend in a class (A) an object (B) a class (C) a data member (D) a data member Ans:B Q.85 What would be the output of the following? #include<iostream.h> void main() { char *ptr= abcd

37 37 char ch; ch = ++*ptr++; cout<<ch; } (A) a (B) b (C) c (D) d Ans:B Q.86 A copy constructor takes (A) no argument (B) one argument (C) two arguments (D) arbitrary no. of arguments Ans:B Q87 Overloading a postfix increment operator by means of a member function takes (A) no argument (B) one argument (C) two arguments (D) three arguments Ans:A Q88 Which of the following ways are legal to access a class data member using this pointer? (A) this.x (B) *this.x (C) *(this.x) (D) (*this).x Ans:D Q.89 If we store the address of a derived class object into a variable whose type is a pointer to the base class, then the object, when accessed using this pointer. (A) continues to act like a derived class object. (B) Continues to act like a derived class object if virtual functions are called. (C) Acts like a base class object. (D) Acts like a base class, if virtual functions are called. Ans:B Q.90 Which of the following declarations are illegal? (A) void *ptr; (B) char *str = hello ; (C) char str = hello ; (D) const *int p1; Ans:C Q.91 What will be the result of the expression 13 & 25? (A) 38 (B) 25 (C) 9 (D) 12 Ans:C Q.92 Which of the following operator can be overloaded through friend function? (A) ->

38 38 (B) = (C) ( ) (D) * Ans:D Q.93 To access the function fbase() in the base class, a statement in a derived class function fder() uses the statement.fbase(); (A) fbase(); (B) fder(); (C) base::fbase(); (D) der::fder(); Ans:A Q.94 If a base class destructor is not virtual, then (A) It can not have a function body. (B) It can not be called. (C) It can not be called when accessed from pointer. (D) Destructor in derived class can not be called when accessed through a pointer to the base class. Ans:D Q.95 Maximum number of template arguments in a function template is (A) one (B) two (C) three (D) many Ans:D Q 96 In access control in a protected derivation, visibility modes will change as follows: (A), and protected become protected (B) only becomes protected. (C) and protected become protected. (D) only becomes protected. Ans:C Q 97 Which of the following statement is valid? (A) We can create new C++ operators. (B) We can change the precedence of the C++ operators. (C) We can change the associativity of the C++ operators. (D) We can not change operator templates. Ans:D Q.98 What will be the output of the following program? #include<iostream.h> void main() { float x=5,y=2; int result; result=x % y; cout<<result; } (A) 1 (B) 1.0 (C) Error message (D) 2.5 Ans:C Q.99 Which can be passed as an argument to a function?

39 39 (A) constant (B) expression (C) another function (D) all of the above. Ans:A Q.100 Member functions, when defined within the class specification: (A) are always inline. (B) are not inline. (C) are inline by default, unless they are too big or too complicated. (D) are not inline by default. Ans:A Q.101 An STL algorithm is a). a standalone function that operate s on containers. b). a link between member functions and containers. c). a friend function of appropriate container classes. d). a member function of appropriate container classes. Q.102. The find() algorithm a). finds matching sequences of elements in two containers. b). finds a container that matches a specified container. c). takes iterators a s its first two arguments. d). takes container elements as its first two arguments. Q.103. Algorithms can be used only on STL containers. a). True b). False Q.104. A vector is an appropriate container if you a). want to insert lots of new elements at arbitrary locations in the vector. b). want to insert new elements, but always at the front of the container. c). are given an index number and you want to quickly access the corre sponding element. d). are given an element s key value and you want to quickly access the corresponding element. Q.105. In a deque() a. data can be quickly inserted or deleted at any arbitrary location. b. data can be inserted or deleted at any arbitrary location, but the process is relatively slow. c. data can be quickly inserted or deleted at either end. d. data can be inserted or deleted at either end, but the process is relatively slow. Q.106. In a set, the insert() member function inserts a key in sorted order. a) True b) False Q.107. To use a reverse_iterator, you should a. begin by initializing it to end(). b. begin by initializing it to rend(). c. increment it to move backward through the container.

40 40 d. decrement it to move backward through the container. X SONO SONO Group Team Disclaimer:- USE IT AT YOUR OWN RISK This file is just compiled by me so if you found any error or wrong answer in this file. Please feel free to me for correction and make this document 100% error free. sono.group.team@gmail.com Remember me in your Prayers You can join Facebook SONO Group Team VUMobile

C++ INTERVIEW QUESTIONS

C++ INTERVIEW QUESTIONS C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get

More information

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement? 1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members

More information

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is preceded by an equal sign d. its name has undereline 2. Associations

More information

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

KITES TECHNOLOGY COURSE MODULE (C, C++, DS) KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL

More information

Glossary of Object Oriented Terms

Glossary of Object Oriented Terms Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction

More information

13 Classes & Objects with Constructors/Destructors

13 Classes & Objects with Constructors/Destructors 13 Classes & Objects with Constructors/Destructors 13.1 Introduction In object oriented programming, the emphasis is on data rather than function. Class is a way that binds the data & function together.

More information

Java Interview Questions and Answers

Java Interview Questions and Answers 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java

More information

El Dorado Union High School District Educational Services

El Dorado Union High School District Educational Services El Dorado Union High School District Course of Study Information Page Course Title: ACE Computer Programming II (#495) Rationale: A continuum of courses, including advanced classes in technology is needed.

More information

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage

More information

C++FA 5.1 PRACTICE MID-TERM EXAM

C++FA 5.1 PRACTICE MID-TERM EXAM C++FA 5.1 PRACTICE MID-TERM EXAM This practicemid-term exam covers sections C++FA 1.1 through C++FA 1.4 of C++ with Financial Applications by Ben Van Vliet, available at www.benvanvliet.net. 1.) A pointer

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

Object Oriented Software Design II

Object Oriented Software Design II Object Oriented Software Design II Introduction to C++ Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 20, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February

More information

WORKSPACE WEB DEVELOPMENT & OUTSOURCING TRAINING CENTER

WORKSPACE WEB DEVELOPMENT & OUTSOURCING TRAINING CENTER WORKSPACE WEB DEVELOPMENT & OUTSOURCING TRAINING CENTER Course Outline (2015) Basic Programming With Procedural & Object Oriented Concepts (C, C++) Training Office# Road: 11, House: 1 A, Nikunja 2, Khilkhet,

More information

www.sahajsolns.com Chapter 4 OOPS WITH C++ Sahaj Computer Solutions

www.sahajsolns.com Chapter 4 OOPS WITH C++ Sahaj Computer Solutions Chapter 4 OOPS WITH C++ Sahaj Computer Solutions 1 Session Objectives Classes and Objects Class Declaration Class Members Data Constructors Destructors Member Functions Class Member Visibility Private,

More information

Fundamentals of Java Programming

Fundamentals of Java Programming Fundamentals of Java Programming This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial distribution and exclusive use by instructors

More information

Java (12 Weeks) Introduction to Java Programming Language

Java (12 Weeks) Introduction to Java Programming Language Java (12 Weeks) Topic Lecture No. Introduction to Java Programming Language 1 An Introduction to Java o Java as a Programming Platform, The Java "White Paper" Buzzwords, Java and the Internet, A Short

More information

IS0020 Program Design and Software Tools Midterm, Feb 24, 2004. Instruction

IS0020 Program Design and Software Tools Midterm, Feb 24, 2004. Instruction IS0020 Program Design and Software Tools Midterm, Feb 24, 2004 Name: Instruction There are two parts in this test. The first part contains 50 questions worth 80 points. The second part constitutes 20 points

More information

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London

More information

CS 111 Classes I 1. Software Organization View to this point:

CS 111 Classes I 1. Software Organization View to this point: CS 111 Classes I 1 Software Organization View to this point: Data Objects and primitive types Primitive types operators (+, /,,*, %). int, float, double, char, boolean Memory location holds the data Objects

More information

C++ Programming Language

C++ Programming Language C++ Programming Language Lecturer: Yuri Nefedov 7th and 8th semesters Lectures: 34 hours (7th semester); 32 hours (8th semester). Seminars: 34 hours (7th semester); 32 hours (8th semester). Course abstract

More information

Subject Name: Object Oriented Programming in C++ Subject Code: 2140705

Subject Name: Object Oriented Programming in C++ Subject Code: 2140705 Faculties: L.J. Institute of Engineering & Technology Semester: IV (2016) Subject Name: Object Oriented Programming in C++ Subject Code: 21405 Sr No UNIT - 1 : CONCEPTS OF OOCP Topics -Introduction OOCP,

More information

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship. CSCI 253 Object Oriented Design: Java Review OOP George Blankenship George Blankenship 1 Object Oriented Programming (OOP) OO Principles Abstraction Encapsulation Abstract Data Type (ADT) Implementation

More information

Object Oriented Programming With C++(10CS36) Question Bank. UNIT 1: Introduction to C++

Object Oriented Programming With C++(10CS36) Question Bank. UNIT 1: Introduction to C++ Question Bank UNIT 1: Introduction to C++ 1. What is Procedure-oriented Programming System? Dec 2005 2. What is Object-oriented Programming System? June 2006 3. Explain the console I/O functions supported

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

Polymorphism. Problems with switch statement. Solution - use virtual functions (polymorphism) Polymorphism

Polymorphism. Problems with switch statement. Solution - use virtual functions (polymorphism) Polymorphism Polymorphism Problems with switch statement Programmer may forget to test all possible cases in a switch. Tracking this down can be time consuming and error prone Solution - use virtual functions (polymorphism)

More information

Semantic Analysis: Types and Type Checking

Semantic Analysis: Types and Type Checking Semantic Analysis Semantic Analysis: Types and Type Checking CS 471 October 10, 2007 Source code Lexical Analysis tokens Syntactic Analysis AST Semantic Analysis AST Intermediate Code Gen lexical errors

More information

An Incomplete C++ Primer. University of Wyoming MA 5310

An Incomplete C++ Primer. University of Wyoming MA 5310 An Incomplete C++ Primer University of Wyoming MA 5310 Professor Craig C. Douglas http://www.mgnet.org/~douglas/classes/na-sc/notes/c++primer.pdf C++ is a legacy programming language, as is other languages

More information

OpenCL Static C++ Kernel Language Extension

OpenCL Static C++ Kernel Language Extension OpenCL Static C++ Kernel Language Extension Document Revision: 04 Advanced Micro Devices Authors: Ofer Rosenberg, Benedict R. Gaster, Bixia Zheng, Irina Lipov December 15, 2011 Contents 1 Overview... 3

More information

Curriculum Map. Discipline: Computer Science Course: C++

Curriculum Map. Discipline: Computer Science Course: C++ Curriculum Map Discipline: Computer Science Course: C++ August/September: How can computer programs make problem solving easier and more efficient? In what order does a computer execute the lines of code

More information

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology) ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology) Subject Description: This subject deals with discrete structures like set theory, mathematical

More information

CIS 190: C/C++ Programming. Polymorphism

CIS 190: C/C++ Programming. Polymorphism CIS 190: C/C++ Programming Polymorphism Outline Review of Inheritance Polymorphism Car Example Virtual Functions Virtual Function Types Virtual Table Pointers Virtual Constructors/Destructors Review of

More information

Chapter 5 Names, Bindings, Type Checking, and Scopes

Chapter 5 Names, Bindings, Type Checking, and Scopes Chapter 5 Names, Bindings, Type Checking, and Scopes Chapter 5 Topics Introduction Names Variables The Concept of Binding Type Checking Strong Typing Scope Scope and Lifetime Referencing Environments Named

More information

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ Answer the following 1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ 2) Which data structure is needed to convert infix notations to postfix notations? Stack 3) The

More information

Operator Overloading. Lecture 8. Operator Overloading. Running Example: Complex Numbers. Syntax. What can be overloaded. Syntax -- First Example

Operator Overloading. Lecture 8. Operator Overloading. Running Example: Complex Numbers. Syntax. What can be overloaded. Syntax -- First Example Operator Overloading Lecture 8 Operator Overloading C++ feature that allows implementer-defined classes to specify class-specific function for operators Benefits allows classes to provide natural semantics

More information

www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk

www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 Which of the following is a general purpose container? JFrame Dialog JPanel JApplet Which of the following package needs to be import while handling

More information

PL/SQL Overview. Basic Structure and Syntax of PL/SQL

PL/SQL Overview. Basic Structure and Syntax of PL/SQL PL/SQL Overview PL/SQL is Procedural Language extension to SQL. It is loosely based on Ada (a variant of Pascal developed for the US Dept of Defense). PL/SQL was first released in ١٩٩٢ as an optional extension

More information

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies) Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies) Duration of Course: 6 Months Fees: Rs. 25,000/- (including Service Tax) Eligibility: B.E./B.Tech., M.Sc.(IT/ computer

More information

Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

More information

Basic Logic Gates. Logic Gates. andgate: accepts two binary inputs x and y, emits x & y. orgate: accepts two binary inputs x and y, emits x y

Basic Logic Gates. Logic Gates. andgate: accepts two binary inputs x and y, emits x & y. orgate: accepts two binary inputs x and y, emits x y Basic andgate: accepts two binary inputs x and y, emits x & y x y Output orgate: accepts two binary inputs x and y, emits x y x y Output notgate: accepts one binary input x, emits!y x Output Computer Science

More information

Introduction to C++ Introduction to C++ Week 7 Dr Alex Martin 2013 Slide 1

Introduction to C++ Introduction to C++ Week 7 Dr Alex Martin 2013 Slide 1 Introduction to C++ Introduction to C++ Week 7 Dr Alex Martin 2013 Slide 1 Introduction to Classes Classes as user-defined types We have seen that C++ provides a fairly large set of built-in types. e.g

More information

1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.

1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D. 1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D. base address 2. The memory address of fifth element of an array can be calculated

More information

C++FA 3.1 OPTIMIZING C++

C++FA 3.1 OPTIMIZING C++ C++FA 3.1 OPTIMIZING C++ Ben Van Vliet Measuring Performance Performance can be measured and judged in different ways execution time, memory usage, error count, ease of use and trade offs usually have

More information

Object Oriented Software Design II

Object Oriented Software Design II Object Oriented Software Design II Real Application Design Christian Nastasi http://retis.sssup.it/~lipari http://retis.sssup.it/~chris/cpp Scuola Superiore Sant Anna Pisa April 25, 2012 C. Nastasi (Scuola

More information

Designing with Exceptions. CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219

Designing with Exceptions. CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219 Designing with Exceptions CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219 Testing vs. Debugging Testing Coding Does the code work properly YES NO 2 Debugging Testing

More information

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 The Java Type System By now, you have seen a fair amount of Java. Time to study in more depth the foundations of the language,

More information

10CS35: Data Structures Using C

10CS35: Data Structures Using C CS35: Data Structures Using C QUESTION BANK REVIEW OF STRUCTURES AND POINTERS, INTRODUCTION TO SPECIAL FEATURES OF C OBJECTIVE: Learn : Usage of structures, unions - a conventional tool for handling a

More information

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C 1 An essential part of any embedded system design Programming 2 Programming in Assembly or HLL Processor and memory-sensitive

More information

2) Write in detail the issues in the design of code generator.

2) Write in detail the issues in the design of code generator. COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage

More information

JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system.

JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system. http://www.tutorialspoint.com/java/java_quick_guide.htm JAVA - QUICK GUIDE Copyright tutorialspoint.com What is Java? Java is: Object Oriented Platform independent: Simple Secure Architectural- neutral

More information

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio. Organization of Programming Languages CS320/520N Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.edu Names, Bindings, and Scopes A name is a symbolic identifier used

More information

Basics of I/O Streams and File I/O

Basics of I/O Streams and File I/O Basics of This is like a cheat sheet for file I/O in C++. It summarizes the steps you must take to do basic I/O to and from files, with only a tiny bit of explanation. It is not a replacement for reading

More information

16 Collection Classes

16 Collection Classes 16 Collection Classes Collections are a key feature of the ROOT system. Many, if not most, of the applications you write will use collections. If you have used parameterized C++ collections or polymorphic

More information

Java Application Developer Certificate Program Competencies

Java Application Developer Certificate Program Competencies Java Application Developer Certificate Program Competencies After completing the following units, you will be able to: Basic Programming Logic Explain the steps involved in the program development cycle

More information

Variable Base Interface

Variable Base Interface Chapter 6 Variable Base Interface 6.1 Introduction Finite element codes has been changed a lot during the evolution of the Finite Element Method, In its early times, finite element applications were developed

More information

AP Computer Science Java Subset

AP Computer Science Java Subset APPENDIX A AP Computer Science Java Subset The AP Java subset is intended to outline the features of Java that may appear on the AP Computer Science A Exam. The AP Java subset is NOT intended as an overall

More information

Symbol Tables. Introduction

Symbol Tables. Introduction Symbol Tables Introduction A compiler needs to collect and use information about the names appearing in the source program. This information is entered into a data structure called a symbol table. The

More information

Tutorial on C Language Programming

Tutorial on C Language Programming Tutorial on C Language Programming Teodor Rus rus@cs.uiowa.edu The University of Iowa, Department of Computer Science Introduction to System Software p.1/64 Tutorial on C programming C program structure:

More information

Lecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists

Lecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists Lecture 11 Doubly Linked Lists & Array of Linked Lists In this lecture Doubly linked lists Array of Linked Lists Creating an Array of Linked Lists Representing a Sparse Matrix Defining a Node for a Sparse

More information

Advanced Data Structures

Advanced Data Structures C++ Advanced Data Structures Chapter 8: Advanced C++ Topics Zhijiang Dong Dept. of Computer Science Middle Tennessee State University Chapter 8: Advanced C++ Topics C++ 1 C++ Syntax of 2 Chapter 8: Advanced

More information

Description of Class Mutation Mutation Operators for Java

Description of Class Mutation Mutation Operators for Java Description of Class Mutation Mutation Operators for Java Yu-Seung Ma Electronics and Telecommunications Research Institute, Korea ysma@etri.re.kr Jeff Offutt Software Engineering George Mason University

More information

CEC225 COURSE COMPACT

CEC225 COURSE COMPACT CEC225 COURSE COMPACT Course GEC 225 Applied Computer Programming II(2 Units) Compulsory Course Duration Two hours per week for 15 weeks (30 hours) Lecturer Data Name of the lecturer: Dr. Oyelami Olufemi

More information

BCS2B02: OOP Concepts and Data Structures Using C++

BCS2B02: OOP Concepts and Data Structures Using C++ SECOND SEMESTER BCS2B02: OOP Concepts and Data Structures Using C++ Course Number: 10 Contact Hours per Week: 4 (2T + 2P) Number of Credits: 2 Number of Contact Hours: 30 Hrs. Course Evaluation: Internal

More information

Course MS10975A Introduction to Programming. Length: 5 Days

Course MS10975A Introduction to Programming. Length: 5 Days 3 Riverchase Office Plaza Hoover, Alabama 35244 Phone: 205.989.4944 Fax: 855.317.2187 E-Mail: rwhitney@discoveritt.com Web: www.discoveritt.com Course MS10975A Introduction to Programming Length: 5 Days

More information

Introduction to Programming Block Tutorial C/C++

Introduction to Programming Block Tutorial C/C++ Michael Bader Master s Program Computational Science and Engineering C/C++ Tutorial Overview From Maple to C Variables, Operators, Statements Functions: declaration, definition, parameters Arrays and Pointers

More information

1. Polymorphism in C++...2

1. Polymorphism in C++...2 1. Polymorphism in C++...2 1.1 Polymorphism and virtual functions... 2 1.2 Function call binding... 3 1.3 Virtual functions... 4 1.4 How C++ implements late binding... 6 1.4.1 Why do I have to know at

More information

Lecture 9. Semantic Analysis Scoping and Symbol Table

Lecture 9. Semantic Analysis Scoping and Symbol Table Lecture 9. Semantic Analysis Scoping and Symbol Table Wei Le 2015.10 Outline Semantic analysis Scoping The Role of Symbol Table Implementing a Symbol Table Semantic Analysis Parser builds abstract syntax

More information

Binary storage of graphs and related data

Binary storage of graphs and related data EÖTVÖS LORÁND UNIVERSITY Faculty of Informatics Department of Algorithms and their Applications Binary storage of graphs and related data BSc thesis Author: Frantisek Csajka full-time student Informatics

More information

Web development... the server side (of the force)

Web development... the server side (of the force) Web development... the server side (of the force) Fabien POULARD Document under license Creative Commons Attribution Share Alike 2.5 http://www.creativecommons.org/learnmore Web development... the server

More information

Programming in C# with Microsoft Visual Studio 2010

Programming in C# with Microsoft Visual Studio 2010 Course 10266A: Programming in C# with Microsoft Visual Studio 2010 Course Details Course Outline Module 1: Introducing C# and the.net Framework This module explains the.net Framework, and using C# and

More information

Lecture 7 Notes: Object-Oriented Programming (OOP) and Inheritance

Lecture 7 Notes: Object-Oriented Programming (OOP) and Inheritance Introduction to C++ January 19, 2011 Massachusetts Institute of Technology 6.096 Lecture 7 Notes: Object-Oriented Programming (OOP) and Inheritance We ve already seen how to define composite datatypes

More information

Chapter 1 Fundamentals of Java Programming

Chapter 1 Fundamentals of Java Programming Chapter 1 Fundamentals of Java Programming Computers and Computer Programming Writing and Executing a Java Program Elements of a Java Program Features of Java Accessing the Classes and Class Members The

More information

Compile-time type versus run-time type. Consider the parameter to this function:

Compile-time type versus run-time type. Consider the parameter to this function: CS107L Handout 07 Autumn 2007 November 16, 2007 Advanced Inheritance and Virtual Methods Employee.h class Employee public: Employee(const string& name, double attitude, double wage); virtual ~Employee();

More information

Specialized Programme on Web Application Development using Open Source Tools

Specialized Programme on Web Application Development using Open Source Tools Specialized Programme on Web Application Development using Open Source Tools Objective: At the end of the course, Students will be able to: Understand various open source tools(programming tools and databases)

More information

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Handout 1 CS603 Object-Oriented Programming Fall 15 Page 1 of 11 Handout 1 Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Java

More information

Lecture 3. Arrays. Name of array. c[0] c[1] c[2] c[3] c[4] c[5] c[6] c[7] c[8] c[9] c[10] c[11] Position number of the element within array c

Lecture 3. Arrays. Name of array. c[0] c[1] c[2] c[3] c[4] c[5] c[6] c[7] c[8] c[9] c[10] c[11] Position number of the element within array c Lecture 3 Data structures arrays structs C strings: array of chars Arrays as parameters to functions Multiple subscripted arrays Structs as parameters to functions Default arguments Inline functions Redirection

More information

Course Title: Software Development

Course Title: Software Development Course Title: Software Development Unit: Customer Service Content Standard(s) and Depth of 1. Analyze customer software needs and system requirements to design an information technology-based project plan.

More information

Terms and Definitions for CMS Administrators, Architects, and Developers

Terms and Definitions for CMS Administrators, Architects, and Developers Sitecore CMS 6 Glossary Rev. 081028 Sitecore CMS 6 Glossary Terms and Definitions for CMS Administrators, Architects, and Developers Table of Contents Chapter 1 Introduction... 3 1.1 Glossary... 4 Page

More information

The Sun Certified Associate for the Java Platform, Standard Edition, Exam Version 1.0

The Sun Certified Associate for the Java Platform, Standard Edition, Exam Version 1.0 The following applies to all exams: Once exam vouchers are purchased you have up to one year from the date of purchase to use it. Each voucher is valid for one exam and may only be used at an Authorized

More information

www.gr8ambitionz.com

www.gr8ambitionz.com Data Base Management Systems (DBMS) Study Material (Objective Type questions with Answers) Shared by Akhil Arora Powered by www. your A to Z competitive exam guide Database Objective type questions Q.1

More information

Stacks. Linear data structures

Stacks. Linear data structures Stacks Linear data structures Collection of components that can be arranged as a straight line Data structure grows or shrinks as we add or remove objects ADTs provide an abstract layer for various operations

More information

Ch 7-1. Object-Oriented Programming and Classes

Ch 7-1. Object-Oriented Programming and Classes 2014-1 Ch 7-1. Object-Oriented Programming and Classes May 10, 2014 Advanced Networking Technology Lab. (YU-ANTL) Dept. of Information & Comm. Eng, Graduate School, Yeungnam University, KOREA (Tel : +82-53-810-2497;

More information

Data Structures Using C++ 2E. Chapter 5 Linked Lists

Data Structures Using C++ 2E. Chapter 5 Linked Lists Data Structures Using C++ 2E Chapter 5 Linked Lists Test #1 Next Thursday During Class Cover through (near?) end of Chapter 5 Objectives Learn about linked lists Become aware of the basic properties of

More information

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6)

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6) Semantic Analysis Scoping (Readings 7.1,7.4,7.6) Static Dynamic Parameter passing methods (7.5) Building symbol tables (7.6) How to use them to find multiply-declared and undeclared variables Type checking

More information

CORBA Programming with TAOX11. The C++11 CORBA Implementation

CORBA Programming with TAOX11. The C++11 CORBA Implementation CORBA Programming with TAOX11 The C++11 CORBA Implementation TAOX11: the CORBA Implementation by Remedy IT TAOX11 simplifies development of CORBA based applications IDL to C++11 language mapping is easy

More information

Basics of C++ and object orientation in OpenFOAM

Basics of C++ and object orientation in OpenFOAM Basics of C++ and object orientation in OpenFOAM To begin with: The aim of this part of the course is not to teach all of C++, but to give a short introduction that is useful when trying to understand

More information

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 3: Input/Output

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 3: Input/Output C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 3: Input/Output Objectives In this chapter, you will: Learn what a stream is and examine input and output streams Explore

More information

11 November 2015. www.isbe.tue.nl. www.isbe.tue.nl

11 November 2015. www.isbe.tue.nl. www.isbe.tue.nl UML Class Diagrams 11 November 2015 UML Class Diagrams The class diagram provides a static structure of all the classes that exist within the system. Classes are arranged in hierarchies sharing common

More information

Course notes Standard C++ programming

Course notes Standard C++ programming Department of Cybernetics The University of Reading SE2B2 Further Computer Systems Course notes Standard C++ programming by Dr Virginie F. Ruiz November, 03 CREATING AND USING A COPY CONSTRUCTOR... 27

More information

Certified PHP Developer VS-1054

Certified PHP Developer VS-1054 Certified PHP Developer VS-1054 Certification Code VS-1054 Certified PHP Developer Vskills certification for PHP Developers assesses the candidate for developing PHP based applications. The certification

More information

CS193D Handout 06 Winter 2004 January 26, 2004 Copy Constructor and operator=

CS193D Handout 06 Winter 2004 January 26, 2004 Copy Constructor and operator= CS193D Handout 06 Winter 2004 January 26, 2004 Copy Constructor and operator= We already know that the compiler will supply a default (zero-argument) constructor if the programmer does not specify one.

More information

Quiz 4 Solutions EECS 211: FUNDAMENTALS OF COMPUTER PROGRAMMING II. 1 Q u i z 4 S o l u t i o n s

Quiz 4 Solutions EECS 211: FUNDAMENTALS OF COMPUTER PROGRAMMING II. 1 Q u i z 4 S o l u t i o n s Quiz 4 Solutions Q1: What value does function mystery return when called with a value of 4? int mystery ( int number ) { if ( number

More information

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science Program Schedule CTech Computer Science Credits CS101 Computer Science I 3 MATH100 Foundations of Mathematics and

More information

Friendship and Encapsulation in C++

Friendship and Encapsulation in C++ Friendship and Encapsulation in C++ Adrian P Robson Department of Computing University of Northumbria at Newcastle 23rd October 1995 Abstract There is much confusion and debate about friendship and encapsulation

More information

Habanero Extreme Scale Software Research Project

Habanero Extreme Scale Software Research Project Habanero Extreme Scale Software Research Project Comp215: Java Method Dispatch Zoran Budimlić (Rice University) Always remember that you are absolutely unique. Just like everyone else. - Margaret Mead

More information

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint) TN203 Porting a Program to Dynamic C Introduction Dynamic C has a number of improvements and differences compared to many other C compiler systems. This application note gives instructions and suggestions

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

[Refer Slide Time: 05:10]

[Refer Slide Time: 05:10] Principles of Programming Languages Prof: S. Arun Kumar Department of Computer Science and Engineering Indian Institute of Technology Delhi Lecture no 7 Lecture Title: Syntactic Classes Welcome to lecture

More information

Classes and Pointers: Some Peculiarities (cont d.)

Classes and Pointers: Some Peculiarities (cont d.) Classes and Pointers: Some Peculiarities (cont d.) Assignment operator Built-in assignment operators for classes with pointer member variables may lead to shallow copying of data FIGURE 3-22 Objects objectone

More information

More C++ Concepts. Operator overloading Friend Function This Operator Inline Function

More C++ Concepts. Operator overloading Friend Function This Operator Inline Function More C++ Concepts Operator overloading Friend Function This Operator Inline Function 1 Review There are different types of member functions in the definition of a class Accessor int Str :: get_length();

More information