0% found this document useful (0 votes)
2K views

Oops Assignment 1

The document contains 15 questions related to object-oriented programming concepts in C++. The questions cover topics such as determining if a number is even or odd, calculating total expenses with discounts, calculating employee salary based on basic salary, finding the sum of digits in a number, defining a bank account class, explaining constructors and destructors, defining classes for boxes and circles/triangles/rectangles using function overloading, defining a complex number class and overloading operators, creating a class hierarchy to represent an educational institution's employee database, using multiple inheritance to derive a child class, explaining upcasting and downcasting with examples, explaining abstract base classes with an example, and differentiating static and dynamic binding with an example. Students are

Uploaded by

MikeSteve
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

Oops Assignment 1

The document contains 15 questions related to object-oriented programming concepts in C++. The questions cover topics such as determining if a number is even or odd, calculating total expenses with discounts, calculating employee salary based on basic salary, finding the sum of digits in a number, defining a bank account class, explaining constructors and destructors, defining classes for boxes and circles/triangles/rectangles using function overloading, defining a complex number class and overloading operators, creating a class hierarchy to represent an educational institution's employee database, using multiple inheritance to derive a child class, explaining upcasting and downcasting with examples, explaining abstract base classes with an example, and differentiating static and dynamic binding with an example. Students are

Uploaded by

MikeSteve
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

OOPS AND DS ASSIGNMENT QUESTIONS

DATE OF SUBMISSION : 04.09.2014

1) Any integer is input by the user. Write a program to find out whether it is an odd number
or even number.
2) Write a program to calculate the total expenses. Quantity and price per item are input by
the user and discount of 10% is offered if the expense is more than 5000.
3) In a company an employee is paid as under:
If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary
and DA = 90% of basic salary.
If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500
and DA = 98% of basic salary.
If the employee's salary is input by the user write a program to find his gross salary.
4) Write a program to sum of digits of given integer number.
5) Define a class to represent a bank account. Include the foll members:
Data Members: 1) Name of depositor
2) Account number
3) Type of account
4) Balance amount in the account
Member Functions: 1) to assign initial values
2) To deposit an amount
3) To withdraw amount after checking the bal;ance
4) To display name and balance
Write a main program and access the classes.
6) What is a constructor and destructor and explain its characteristics
7) Write a class named box with data member width of the box and member function
setwidth to set the width of the box and a non member function printwidth to print the
width of box . printwidth function is the friend of setwidth function. Use necessary
objects and access them.
8) Write a c++ program to find area of circle,triangle and rectangle.Use function
overloading concept.
9) Specify a class complex to represent the complex number and overload +,-,* and /
operators when working on the objects of the class.
10) An educational institution wishes to maintain database of its employees. The database is
divided into number of classes whose hierachial relationships are

Specify all the above classes and define functions to create the database and retrieve
information as and when required.
11) Create 2 base classes A and B.Create a contructor A() in class A which is parameterized
with values int a and float b. Create a contructor B() in class B which is parameterized
with values double c and float d. Use multiple inheritance and derive a child class from A
and B and create a derived constructor with necessary syntax and supply needed values to
the base classes from derived class.
12) Write the difference between up casting and down casting with syntax and write
programs for both

13)

14) Explain abstract base class with an example.


15) Differentiate static and dynamic binding with an example.

NOTE: Answer all the above questions in an 80 pages notebook.

You might also like