July 9, 2021 in C and CPP
What are manipulators? Write the general form of the user defined manipulators.
a) What are manipulators? Write the general form of the user defined manipulators.
July 9, 2021 in C and CPP
a) What are manipulators? Write the general form of the user defined manipulators.
July 9, 2021 in C and CPP
6. Design classes such that they support the following statements:
Dollar d1, d2;
Rupee r1, r2;
Write a complete program which does such conversions according to the world market
value. Take $ 1 = Rupee 39.45 as a conversion factor.
July 9, 2021 in C and CPP
5. Write a program in C++, to create a STUDENT class having name of student maximum
of 20 characters, and the (whole number) individual marks in four tests and the average
(whole number) of these four tests as elements of the class. Also the member function
AVG ( ), READDATA ( ) and DISPLAY ( ) of the class. Read the value of N as number of
students, and their names and respective marks in four tests and store these N student
objects in the program dynamically. Now process this information in member function
AVG ( ) to find the average of marks of these N individual students and store them in the
average data member of these N objects. If the remainder of the average is greater than
or equal to 50% of the divisor, increment the average by one. Print the name and
average of the tests for all students.
July 9, 2021 in C and CPP
A. public B. namespace name C. constructor
D. istream& E. Standard Template
Library
F. free store
G. stream& H. Local I. friend
J. class K. global L. Open
M compile-time N flush O run-time
4.1 Classes can be defined and used inside a function or a block. Such classes are called
as ________ classes.
4.2 Same variable declared and assigned with different values in various nested blocks can be accessed by using ________.
4.3 The class cannot have virtual ________, but can contain virtual destructor.
4.4 The new and delete are known as ________ operators.
4.5 The typeid operator is used to find the type at ________ of unknown objects.
4.6 The collection of generic classes and functions is called ________.
4.7 The flag ios::stdio is used to ________ stdout and stderr after insertion.
4.8 ________ functions have access to the private and protected members of a class.
4.9 To get benefits of virtual functions supporting runtime polymorphism, they should be
declared in the ________ section of a class.
4.10 The overloading of extraction operator for user defined types should have a return type of ________.
July 9, 2021 in C and CPP
Each statement below is either TRUE or FALSE. Choose the most appropriate one
and ENTER in the “tear-off” sheet attached to the question paper, following
instructions therein.
2.1 Pointer to a function cannot be created.
2.2 Virtual classes are the same as virtual function.
2.3 A class object can have a pointer, but its data members cannot have pointers.
2.4 For destroying class objects, we use garbage collector technique.
2.5 Virtual functions cannot be static members.
2.6 iostream is inherited from istream, ostream and ios class.
2.7 Functions can return an object.
2.8 Macros work in the same way as functions work.
2.9 Function parameter cannot be a given default value.
2.10 Template is a keyword.
July 9, 2021 in C and CPP
1.10 #include is a
A) Compiler statement
B) Debugging statement
C) Pre-processor statement
D) None of the above
July 9, 2021 in C and CPP
1.9 ios represents
A) A class member function.
B) A constant object.
C) A stream.
D) A base class.
July 9, 2021 in C and CPP
1.8Binary overloaded operators are passed.
A) two arguments
B) one arguments
C) no arguments
D) three arguments
July 9, 2021 in C and CPP
1.7 A global variable declaration is made
A) Only in main function.
B) Only in functions other than main function.
C) Only outside functions.
D) None of the above.
July 9, 2021 in C and CPP
1.6 Inline function acts as a
A) Function.
B) Macro.
C) Operator.
D) Manipulator.