Lab Sessional Possible Question List
Lab Sessional Possible Question List
Lab Sessional Possible Question List
1. Given that an EMPLOYEE class contains the following members: Data Members: Employee_Number, Employee_Name, Basic, DA, IT, Net_Sal Member Functions: to read data, to calculate Net_Sal and to print data members Write a C++ program to read data on N employees and compute the Net_Sal of each employee (DA = 52% of Basic and Income Tax = 30% of the gross salary) 2. Define a STUDENT class with USN, Name, and Marks in 3 tests of a subject. Declare an array of 10 STUDENT objects. Using appropriate functions, find the average of the two better marks for each student. Print the USN, Name and the average marks of all the students. 3. Write a C++ program to create a class called COMPLEX and implement the following overloading functions ADD that return a complex number: (i) ADD(a, s2) where a is an integer (real part) and s2 is a complex number (ii) ADD(s1, s2) where s1 and s2 are complex numbers 4. Write a C++ program to create a class called STACK using an array of integers. Implement the following operations by overloading the operators + and -: (i) s1 = s1 + element; where s1 is an object of the class STACK and element is an integer to be pushed on the top of the stack (ii) s1 = s1- ; where s1 is an object of the class STACK. -operator pops the element. Handle the STACK empty and full conditions. Also display the contents of the stack after each operation, by overloading the << operator. 5. Create a class called MATRIX using two-dimensional array of integers. Implement the following operations by overloading the operator ++ which checks the compatibility of two matrices to be added and subtracted. Perform the addition and subtraction by overloading the + and operators respectively. Display the results by overloading the operator <<. If (m1==m2) then m3 = m1+m2 and m4 = m1-m2 else display error. 6. Write a C++ program to create a class called STUDENT with data members USN, Name and Age. Using inheritance, create the classes UGSTUDENT and PGSTUDENT having fields as Semester, Fees and Stipend. Enter the data for at least 5 students. Find the semester-wise average age for all UG and PG students separately. 7. Write a C++ program to create a class called STRING and implement the following operations. Display the results after every operation by overloading the operator <<. (i) STRING s1 = NMAMIT (ii) STRING s2 = NITTE (iii) STRING s3 = s1 + s2 (Use copy constructor) 8. Write a program that uses a function template called min to determine the smaller of two arguments. Test the program using integer, character and floating-point number arguments
9. Time Program. 10. Vector Program. [Chapter 6 Notes] 11. Point Program. [Chapter 6 Notes] 12. WAP to define different implementations for a single template by using template specialization. 13. WAP to parametrize templates on regular types. 14. Demonstrate the usage of iterator, binary_search(), sort, rotate & reverse functions from Standard Template Library (STL). 15. WAP to find out the student details using Multiple Inheritance. Student, Sports & Statement classes. 16. Program to demonstrate overloading of different Constructors viz. defaut ctor, 1,2,3 parameterized ctors, copy ctor & dynamic ctor. 17. Program on operator overloading with respect to +,-, *, /, [], ->, =, ==, ++, -- (pre & post), <<. >>. Also with & without friend functions. 18. Constructors in derived class. 19. Initialization list in constructors. 20. Virtual base classes & Abstract classes. 21. Virtual function (Animal & Window Class examples) & Pure Virtual function related program. 22. Program on dynamic arrays & storage classes. 23. Programs on private member functions, static member functions, friend functions, inline functions. 24. Kilometer & Miles program for convertion among different class types. 25. Constructors in Multiple Inheritance - Item class. 26.Multilevel Inheritance - Student, Test, & Result class. 27. Hybrid Inheritance - Student, Test, Sports & Result class.