Electrofriends

C++ program to implement three classes using multiple inheritance

by Ranjith | March 13th, 2010.

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 p,ie P p
• Call p.get_m(),assign the value in to ‘m’
• Call p.get_n(),assign the value in [...]

Read More..

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

by Ranjith | March 12th, 2010.

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
PROGRAM

#include<iostream.h>
#include<conio.h>
class stu
{
private: char name[20],add[20];
int roll,zip;
public: stu ( );//Constructor
~stu( );//Destructor
void read( );
void disp( );
};
stu :: [...]

Read More..

C++ program for implementation of class

by Ranjith | March 12th, 2010.

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 ( b*b-4*a*c)=0
ii) Call img();
iii) Otherwise : call real(a,b,c);
6) Stop the process
PROGRAM:

#include<iostream.h>
#include<conio.h>
class equation
{
private:float a,b,c;
public: void getinfo(float a, float b,float c );
void display( [...]

Read More..

Lexical Analyzer

by Ranjith | November 20th, 2008.
Lexical Analyzer

Lexical analyzer converts stream of input characters into a stream of tokens. The different tokens that our lexical analyzer identifies are as follows:
KEYWORDS: int, char, float, double, if, for, while, else, switch, struct, printf, scanf, case, break, return, typedef, void
IDENTIFIERS: main, fopen, getch etc
NUMBERS: positive and negative integers, positive and negative floating point numbers.
OPERATORS: +, [...]

Read More..

Share and enjoy

    • Digg
    • Facebook
    • Technorati
    • StumbleUpon
    • Twitter
    • Reddit
    • del.icio.us
    • Yahoo! Buzz
Copyright©2009 www.electrofriends.com All Rights Reserved. Powered by Dhyeya