INDEX
C++ PROGRAMS
SERIAL NO.                        LIST OF PROGRAMS                             PAGE NO.
                                         PART – A
             Write a C++ program to calculate the volume of cube,
    1.
             cylinder and rectangle using function overloading.
             Write a C++ program to perform the addition and
    2.       subtraction of two complex numbers using member
             functions.
             Write a C++ program to compute the total marks and
             declare the results using array of objects. Assume that the
             class contains the data members - roll no, name, marks in 3
             subjects.
                    Result is calculated as follows.
    3.
             i.          If student gets <35 fail. Otherwise various results
             are calculated on average as
             ii.        >=70 Distinction.
             iii.       >=60 and <70 First Class.
             iv.        >=50 and <60 Second Class else Pass Class
             Create a class DISTANCE with the data members feet and
             inches and the member functions read() and show(). Write a
    4.
             C++ program to add two distances by using objects as function
             arguments.. (inches should not be >=12)
             Write an object oriented program in C++ to create a library
             information system containing the following for a book in the
             library:
             Accession number, Author name, Title of the book, Year of
    5.
             publication, Publisher’s name, Cost of the book.
             Define a class with data members and suitable member
             functions for initializing and for destroying the data viz
             constructor, destructor.
SERIAL NO.                        LIST OF PROGRAMS                             PAGE NO.
                                           PART – B
             Create a class ‘Bank’ which include data members – Acno,
             Name, Balance and parameterized constructor to initialize
             the data members and               other methods like deposit,
    1.
             withdrawal, and display the detail of the customer.
                 (Hint: Minimum balance of Rs. 500/- should be maintained
             and      amount should be positive.)
             Using constructors and proper methods design a class graphics
             which stores shapes, area, back color and fore colors. Use
             this class in the main program to input any ‘N’ shapes and
    2.       perform the following options and print the list in the neat
             format.
                     a. Sort according to Area.
                     b. Search according to accepted shape.
             Write a program to accept two strings and using operator
             overloading perform the following.
    3.                a. Concatenation of two strings.
                      b. Comparison of two strings alphabetically.
                (Note : For concatenation (+), for comparison (= =, >, <)
             Using operator overloading concepts do the following.
                               i. To add two complex numbers
                              ii. To subtract complex numbers
    4.                       iii. To compare two complex numbers.
                     (Hint : To add (+) ,to subtract (-) , to compare only ==
                 must be overloaded and compare the real with real and
                 imaginary with an imaginary part).
             Create a class called ‘Time’ which includes the data members –
             hours, minutes and seconds. Use the method
                                  1.     To accept the time.
                                  2.     To display the time.
                                  3.     To increment time by one second by
    5.                                   overloading unary operator ++.
                                  4.     To decrement time by one second
                                         by overloading unary operator - -.
               Write a menu driven program for the above operation,
                  (Hint : Minutes and Seconds must be always within the
             range 0-59).
             Create a class Rectangle with length, breadth and area. Create
             another class Cuboid that inherits Rectangle and has additional
    6
             members height and volume. Use single inheritance property.
SERIAL NO.                        LIST OF PROGRAMS                              PAGE NO.
                                  PART – C
     Hierarchy Inheritance: Create a base class ‘Item’ with data
     members item number, title and price. Derive the following
     items for base class item.
          i ‘Book’ with author name, publication and pages as the
1.           data members.
         ii CD with data members - category, time of play and
             speed. Issue desired number of items and print the
             books and cd’s separately. Also find the number of
             books, cd’s and total no. of items purchased
     Multiple Inheritance: Write a program to create a class
     ‘Personnel Information’ which includes name, address and
     gender as the data members. Another class for ‘Physical
     Information’ with data members height, weight, blood group.
     Derive a class called ‘Salary’ with employee number,
2.   department and salary. Find increment in salary for an
     employee as follows.
            For Male : In department S or P- 10%
            For Female : In department S or P- 11%.
              (Hint: S for Sales and P for Purchase, for any other
          department no increment)
     Create a class called Employee containing name and emp_no.
     Create other 2 classes        Manager with data members
     department name and no of employees under that
3.   department and Scientist with data members year and no. of
     publications. Using the concept of containership read all the
     information of a Scientist and Manager and display the
     information in a neat format.
     Write a C++ program to create a class called person having the
     name, age, sex, occupation as its data members and getdata()
     and putdata() as its member functions. Now, create two new
4.
     classes called student and employee. Add the suitable
     members to these two classes. In the base class, declare the
     member functions as virtual.