You are on page 1of 2

VIT UNIVERSITY

School of Information Technology and Engineering Course: MCA Semester: I


Course Code: ITA 416

DATA STRUCTURES USING C++ LAB

1. 2. 3. 4. 5.

Write a C++ program to find the sum of the digits of a given number. Write a program in C++ to solve a general quadratic equation ax2 +bx+c=0. Program illustrating function overloading feature. Programs illustrating the overloading of various operators Ex : Binary operators, Unary operators, New and delete operators etc. Programs illustrating the use of following functions : a.

Friend functions b) Inline functions c) Static Member functions d) Functions with default arguments. 6. Write a program in C++ to read students particulars such as roll number, age, sex, height and weight from the keyboard and display the contents of the class on the screen. The class 'student' is defined as an array of class objects. 7. Programs illustrating the use of destructor and the various types of constructors (no arguments, constructor, constructor with arguments, copy constructor etc). 8. Develop an object oriented program in C++ to create a data base of the personal information system containing the following information: Name Date of birth Blood group Height Weight Insurance policy number Contact address Telephone number Driving licence number Construct the data base with suitable member functions for initializing and destroying the data viz default constructor, copy constructor, destructor, static member functions, friend function, this pointer, inline code and dynamic memory allocation operators - new and delete. 9. Write a C++ program to overload the new and delete operators to provide custom dynamic allocation of memory. 10. Write a program define a class to represent a bank account include the following data members name of the depositor, account no, balance amount 1. Assign initial value 2. Deposit the amount 3. Withdraw amount after checks the balance 4. Display the name & balance write a program with test 10 customers.

Create two classes DM & DB which store the value of distances DB stores distance in meters and cenTimeters and DB in feet and inches. Write a program that can read values for the class objects and add one objects DM with another objects of DB use a friend function to carry out the addition operation. The object that stores the result may be an DM objects or DB object depending on the s in which the results are required . The display should be in the format of feet and inches or meters in cenTimeters depending on the objects on display. 11. Programs illustrating the various forms of inheritance : Ex. Single, Multiple, multilevel, hierarchical inheritance etc. 12. Write a program having student as on abstract class and create many derived classes such as Engg. Science, Medical, etc. from students class. Create their objects and process them. 13. Design a class "university". It has name and place as data members. Their member functions are for printing and getting data members. Derive 'Department' class from university class protected. Its data members are department name, no of students, and number of staffs. Member functions are for getting and printing data members. Derive one more class staff from department data members are name of staff, salary, experience (in years) and subject. Another class student is derive from department as student. Data members are name of student, years of course, course and total marks. These two classes are derived from parent class in private mode. Write a C+ + program for the above situation. 14. Write a program illustrating the use of virtual functions. 15. Write a program which illustrates the use of virtual base class. 16. Write programs illustrating file handling operations: Ex. a) Copying a text file b) Displaying the contents of the file etc. 17. Write programs illustrating how exceptions are handled (ex: division-by-zero, overflow and underflow in stack etc).

You might also like