Bank of Question-Final
Bank of Question-Final
Bank of Question-Final
SECTION A
1. List and explain any 2 principles of object oriented programming with adequate examples
2. What are conditional or decision making statements? Explain which adequate example.
3. What is the difference of iteration and conditional statement? Please list and explain at list
2 of iterative statements.
4. Define class and object. Explain the 3 characteristics of an object.
5. List any 5 benefits of object oriented approach.
6. Explain setw( ) function with proper example.
7. What is meant by function? explain function prototyping and function definition with
proper example
8. Explain function with and without arguments with proper example.
9. Explain default and constant arguments.
10. Explain 5 categories of errors in programming.
11. Define arrays? Explain different types of arrays.
12. Write a c++ program to accept and print one dimensional array.
13. Define structure? Explain structure by giving appropriate example.
14. Compare and contrast structure and class
15. Compare arrays and structures.
16. Explain arrays of structures with proper example.
17. Differentiate and explain public , private and protected access specifier with proper
programming example
18. Define encapsulation and abstraction ,how do you implement it in C++
19. What is meant by static variables? Give appropriate example.
20. What is the difference between friend function and friendly function? Explain with
proper example.
21. What is an operator? Name different types of operators.
22. Explain the difference between postfix and prefix unary operators.
23. What is type conversion? Explain two types of type conversion.
24. Explain break and continue statement by giving appropriate program as example
25. What is local scope? Explain with proper example.
26. Explain the difference between strcmp( ) and strcmpi( )
27. Explain the difference between strcat( ) and strncat( )
28. Explain the difference between strcpy( ) and strncpy( )
29. Compare and contrast constructors and destructors. Give 5 structures of each,
30. Define a pointer. Give various advantages of pointers?
31. Explain call by value by giving correct example.
32. Define polymorphism. What is meant by function and operator overloading.
33. Define inheritance. Explain three types of inheritance.
34. Define generalization and abstract class.
SECTION B
12)A palindrome is a string of characters that reads the same forwards as backwards.
For example, the following are both palindromes: 1457887541 or madam
Write a program that prompts the user to input a string of a size 50 characters or less. Your
program should then determine whether or not the entered string is a palindrome. A
message should be displayed to the user informing them whether or not their string is a
palindrome.
13) Write a c++ program to get the following inputs – Student Name, Mark1, Mark2, Mark3.
Calculate Total = Mark1 + Mark2 + Mark3. If a Student receives less than 50 marks in
any one of the 3 subjects the status of the student is set to failed else passed. Display the
following - Name, Mark1, Mark2, Mark3, Average and Status as output.
14) Write a program with if statement to get the largest of 3 nos.
15)
SECTION C
Question 1
Question 2
Question 3
Question 4
Question 5
Question 2
Write a C++ program to create a class utility_bills with function class accept( ),calculate( )
and display() to handle the following utility details for a given household:
Accept the utility Name ,No.of units
Calculate the utility total bill which is either of type “Water” or “Power”. The
cost of unit is 4.00 for Power and 2.50 for Water. Utility Total is calculated by
the no. of units * cost per unit.
Display the Employee Name, Employment Type, Rate/hour, hours worked and salary.
The program should be able display the output in the following output format :
Utility Name No.of units Cost per unit Utility total bill
Water 200 2.50 500.00
Power 100 4.00 100.00
QUESTION 3
Create a class emp_salaries that can handle employees’ salaries. You are to ensure that the
total salary can be displayed. Thus
You are to create structures employee which should have elements employee name and
salary. The program should enable that it can handle information for several employees (for
this exam ensure that the system can handle at least 3 employees)
You are to create a functions to
1. Accept employee details
2. Calculate the tax for the employees
3. Display the employee name, salary ,calculated tax and Net Salary