Bank of Question-Final

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

REVISION QUESTIONS

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

1) Write a C++ program to read and print 2_D array.


2) Write a C++ program to find trace of a matrix.
3) Write a C++ program to compare two strings.
4) Write a C++ program to reverse a string.
5) Write a C++ program to copy one string into another using string function.
6) Write a C++ program to concatenate two strings using strcat( ) function.
7) Write a C++program to show unary operator overloading.
8) Write a C++ program to show binary operator overloading.
9) With the concept of arrays ,write a C++ program to show stream insertion and
stream extraction .
10) Write a c++ program to find the number of words in a given sentence
11) Write a program to produce the pyramid of starts below:

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

Additional questions for practice


Write a C++ program by creating an Employee class which functions accept( ),calculate( )
and display()
 Accept the Employee Name, Type, and Rate /hour, Hours
 Calculate the salary based on the type of employment and the number of hours worked.
Employment Type can be categorized as either “Full Time”, “Part Time”. Full Time is
400.00 per hour and Part Time is 300.00 per hour. Salary is calculated by the formula
Salary = rate per hour * hours.
 Display the name ,type of employment ,rate/hour, hours worked and salary as following
Name Type Rate/hour Hours
salary
Ranganai Full Time 400.00 20 8000.00
Runako Part Time 200.00 45 9000.00
Rufadzo Full Time 400.00 25 10000.00

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

The tax varies with the salary band. As follows:

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

You might also like