C++ program to implement three classes using multiple inheritance

Saturday, March 13th, 2010  »  Posted By Ranjith  »  Total 2 Comments

MULTIPLE INHERITANCES AIM: Write a program to illustrating how all the three classes are implemented in multiple inheritance mode ALGORITHM • Start the process • Invoke the class M • Invoke the another class N • Invoke one more class,ie class P,which is inherited by both M and N • Create an object for class [...]

C++ program to illustrate Multilevel Inheritance

Saturday, March 13th, 2010  »  Posted By Ranjith  »  Total 5 Comments

MULTILEVEL INHERITANCE AIM: A program to illustrate multilevel inheritance. we have three classes, student, test and result. Here class student is the base class. And the class test is derived from the base class student. And the another class result is derived from the class test. ALGORITHM: • Start the process • Invoke the base [...]

C++ program to illustrate a Single Inheritance

Saturday, March 13th, 2010  »  Posted By Ranjith  »  Total 7 Comments

SINGLE INHERITANCE AIM: A program to illustrate a single inheritance. We have a base class B and a derived class D. The class B contains one private data member, one public data member and three public member functions. The class D contains one private data member and two public member functions ALGORITHAM: • Start the [...]

C++ program to perform arithmetic operations of two complex numbers using operator overloading

Saturday, March 13th, 2010  »  Posted By Ranjith  »  Total 6 Comments

BINARY OPERATOR AIM: A program to perform simple arithmetic operations of two complex numbers using operator overloading. ALGORITHAM: • Start the process • Get the complex value a.real and a.image • Check while ((ch=getchar())!=’q’) o True : execute switch(ch) o Case ‘a’:Then Compute c

C++ program for overloading the unary operator ++.

Saturday, March 13th, 2010  »  Posted By Ranjith  »  Total 0 Comment

ALGORITHAM: • Start the process • Invoke the class counter • Crate two objects c1 and c2 • Assign values to c1 an c2 o Call c1.get_count() o Call c2.get_count() • Increment the values o C1++ o C2++ o ++c2 • Print c1 and c2 • Stop the process PROGRAM #include<iostream.h> #include<conio.h> class counter { [...]

C++ program to swap two variables using function overloading

Saturday, March 13th, 2010  »  Posted By Ranjith  »  Total 8 Comments

FUNCTION OVERLOADING AIM: A program to demonstrate how function overloading is carried out for swapping of two variables of the various data types, namely integer, floating point number and character types ALGORITHAM: • Start the process • Get the integer values of ix,iy • Get the floating values of fx,fy • Get the character values [...]

c++ Program to illustrate the use of difference operators using friend function

Saturday, March 13th, 2010  »  Posted By Ranjith  »  Total 0 Comment

AIM: A program to illustrate the use of difference operators to access the class member using friend function ALGORITHM: 1) Start the process 2) Invoke the classes 3) Call the set_xy() first a) Assign the value of x and y b) Print the value of x and y 4) Call the sum() for second(friend) a) [...]

C++ program to print student details using constructor and destructor

Friday, March 12th, 2010  »  Posted By Ranjith  »  Total 3 Comments

CONSTRUCTOR AND DESTRUCTOR AIM: A program to print student details using constructor and destructor ALGORITHAM: 1. Start the process 2. Invoke the classes 3. Call the read() function a. Get the inputs name ,roll number and address 4. Call the display() function a. Display the name,roll number,and address of the student 5. Stop the process [...]

C++ program for implementation of class

Friday, March 12th, 2010  »  Posted By Ranjith  »  Total 0 Comment

AIM: A program to solve a quadratic equation, using OOP techniques. ALGORITHM: 1) Start the process 2) Invoke the classes 3) Get the input for a,b,c; 4) Call the function getinfo() and display() 5) Check if a=0 a) True : compute c/b; i) Print the value of a/c; b) False: compute b*b-4*a*c; i) If ( [...]

C++ program that uses dynamic programming algorithm to solve the optimal binary search tree problem

Thursday, March 11th, 2010  »  Posted By Ranjith  »  Total 1 Comment

/* Write a C++ program that uses dynamic programming algorithm to solve the optimal binary search tree problem */ #include<iostream> #include<conio.h> #include<stdio.h> using namespace std; #define MAX 10 int find(int i,int j); void print(int,int); int p[MAX],q[MAX],w[10][10],c[10][10],r[10][10],i,j,k,n,m; char idnt[7][10];   main() { cout << "enter the no, of identifiers"; cin >>n; cout <<"enter identifiers"; for(i=1;i<=n;i++) gets(idnt[i]); [...]

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup