0% found this document useful (0 votes)
77 views

Assignment List For Bca-3 SEMESTER, 2017 Subject: Object Oriented Programming Using C++ Assigned By: Dr. Samarjit Das

This document contains 13 assignments for an Object Oriented Programming using C++ course. The assignments involve writing C++ programs to: 1) Define a student class with data members and member functions to store and manipulate student data 2) Define a Complex class with data members and functions to represent and operate on complex numbers 3) Define a matrix class with functions to perform operations like determinant, minor, cofactor, transpose, adjoint and inverse on a matrix 4) Illustrate a parameterized constructor with default values 5) Illustrate constructor overloading with different constructor types 6) Illustrate single inheritance 7) Illustrate multilevel inheritance 8) Illustrate multiple inheritances 9) Illustrate hierarchical inheritance

Uploaded by

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

Assignment List For Bca-3 SEMESTER, 2017 Subject: Object Oriented Programming Using C++ Assigned By: Dr. Samarjit Das

This document contains 13 assignments for an Object Oriented Programming using C++ course. The assignments involve writing C++ programs to: 1) Define a student class with data members and member functions to store and manipulate student data 2) Define a Complex class with data members and functions to represent and operate on complex numbers 3) Define a matrix class with functions to perform operations like determinant, minor, cofactor, transpose, adjoint and inverse on a matrix 4) Illustrate a parameterized constructor with default values 5) Illustrate constructor overloading with different constructor types 6) Illustrate single inheritance 7) Illustrate multilevel inheritance 8) Illustrate multiple inheritances 9) Illustrate hierarchical inheritance

Uploaded by

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

ASSIGNMENT LIST FOR BCA-3rd SEMESTER , 2017

SUBJECT : OBJECT ORIENTED PROGRAMMING USING C++


Assigned by: Dr. Samarjit Das

1. Write a program in C++ to define a class named student which


includes the following data members and member functions-
Data members: EnrNo, StdName, courseName, semester, session, marks (in
three subjects), totalMarks, rank.
Member functions: void getData() // which takes input from user
int total() // it calculates the total marks
int passFail() /*will return 1 if the student is passed
else it returns 0. A student is declared passed if he/she obtains more than or
equal to 30% in each subject or more than and equal to 50% in average. */
float avg() // returns average value
int findRank() /* rank is given to only those students
who have been declared passed. This function returns the rank of a student. */
void showData() /* displays the whole information of a
student. */

2. A class named Complex has the following data members and member
functions.
Data members: real, imaginary.
Member functions: Complex() /* which initialize the data members with value
0 */
Complex(int, int) /* a parameterized constructor which
assigns the data members with new values */
addDistance() /* takes two objects (of type Complex) as
formal parameters and returns an object of type complex
which carries the sum of the corresponding data members
of the two objects. */
showDistance() /* displays a complex number, say, 7+i5,
where 7 is the real part and 5 is the imaginary part. */
Implement the above using C++ as the programming language.

Page 1 of 3
3. Write a program in C++ to define a class named matrix which includes
the member functions-
getMatrix() // takes the inputs of a square matrix.
Determinant() // finds the determinant
Minor() /* finds the minor of the elements of the
determinant. */
CoFactor() /* finds the cofactor of the elements of the
determinant */
Transpose() // calculates the transpose of the matrix.
Adj() // calculates the adjoint of the matrix.
Inverse() // calculates the inverse of the matrix.

4. Write a program in C++ which illustrates the concept of a parameterized


constructor with default values.

5. Write a program in C++ which illustrates the concept of constructor


overloading. (Include a default constructor, a parameterized constructor and a
copy constructor in the same class).

6. Write a program in C++ which illustrates the concept of single


inheritance.

7. Write a program in C++ which illustrates the concept of multilevel


inheritance.

8. Write a program in C++ which illustrates the concept of multiple


inheritances.
9. Write a program in C++ which illustrates the concept of hierarchical
inheritance.

10. Write a program in C++ which illustrates the concept of data ambiguity in
multipath inheritance. Also, provide the solution to it.

Page 2 of 3
11. Suppose O1 is an object of a class named negate which includes data
members- m and cm. The statement O1; negates the value of the data
members m and cm of object O1.
Write a C++ program to implement the above.

12. Write a program in C++ which implements the following statement-


O3= O1 + O2; where O1, O2 and O3 are the objects of a class
named distance which includes data members- feet and inches.

13. str, str1 and str2 are three objects of a class named string.
The statement-
str = str1+ str2; concatenates two strings of objects str1, str2
and returns the resultant string which is assigned to str.
Write a C++ program to implement the above problem..

Page 3 of 3

You might also like