Important Questions CPP
Important Questions CPP
Important Questions CPP
UNIT-I
www.eduwing.blogspot.in
Important Questions
UNIT-II
www.eduwing.blogspot.in
Important Questions
UNIT-III
www.eduwing.blogspot.in
Important Questions
28. Give a class specification for time in hours, minutes and seconds and write a
member function that determines the difference between two times. Assume
that all times are in 24 hour format.
UNIT-IV
www.eduwing.blogspot.in
Important Questions
UNIT-V
1. What are generic classes? Describe tools available in C++ to define generic
classes. 6
2. Define throw and catch mechanisms in C++. 6
3. Define exception? How are they handled in C++. 6
4. Write a program to read integers and when a non-integer is encountered
throw exception.
5. What are the advantages of using templates in C++ programming
6. Explain the differences between Templates and Macros
7. Write a program to demonstrate the concept of rethrowing an exception
8. Define a class template for a stack
9. What is exception? Explain exception handling with examples
10. Explain function templates with multiple parameters
11. Explain the use of nested class templates
12. Describe the process of throwing parameterized objects of a nested
exception class
13. Explain Function Templates with an example
14. Define Class Templates with an example
15. Write a C++ program that tests Divide by zero and divide by negative
number
16. Describe the limitations of exception handling in C++
www.eduwing.blogspot.in
Important Questions
17. Define a function template that returns the sum of an array of elements. The
function must use two arguments-the type of array (generic) and the size of
array (int)
18. What is generic programming? How is it implemented in C++?
19. Distinguish between overloaded functions and function templates.
20. What are the advantages of using exception handling mechanism in a
program.
21. When should a program throw an exception?
22. A template can be considered as a kind of macro. Explain the difference
between them.
23. Distinguish between the terms class template and template class.
24. What is an exception? How is an exception handled in C++?
25. What is an exception specification? When is it used?
www.eduwing.blogspot.in