#include<iostream.h>
#include<string.h>
#include<conio.h>
#include<stdio.h>
class Personnel
{
protected:
char name[15];
char address[50];
char email_id[20];
char bdate[10];

public:
void getdata()
{
cout<<endl<<"Enter name\n";
cin>>name;
fflush(stdin);
cout<<endl<<"Enter address\n";
cin>>address;
fflush(stdin);
cout<<endl<<"Enter email-id\n";
cin>>email_id;
fflush(stdin);
cout<<endl<<"Enter birth date\n";
cin>>bdate;
fflush(stdin);
}

friend void print();
};//End of Personnel class

class Academic
{
protected:
float tenth;
float twelth;
char Class[30];
public:
void get_result()
{
cout<<endl<<"Enter marks in tenth\n";
cin>>tenth;
cout<<endl<<"Enter marks in twelth\n";
cin>>twelth;
if((tenth+twelth)/2>=75)
strcpy(Class,"First Class with Distinction!");
if((tenth+twelth)/2<75 && (tenth+twelth)/2>=60)
strcpy(Class,"First Class");
if((tenth+twelth)/2<60 && (tenth+twelth)/2>=55)
strcpy(Class,"Higher Second Class");
if((tenth+twelth)/2<55 && (tenth+twelth)/2>=50)
strcpy(Class,"Second Class");
if((tenth+twelth)/2<50 && (tenth+twelth)/2>=40)
strcpy(Class,"Pass Class");
if((tenth+twelth)/2<40)
strcpy(Class,"Fail");
}

friend void print();
};//End of Academic class

class biodata:public Personnel,public Academic
{
public:
void print()
{
clrscr();
cout<<endl<<"\t\t\t\tBiodata";
cout<<endl<<"\t\t\t\t_______";
cout<<endl<<endl<<"Personnel Information:"<<endl;
cout<<"______________________________________________"<<endl;
cout<<endl<<"Name        : "<<name;
cout<<endl<<"Address     : "<<address;
cout<<endl<<"Email-Id    : "<<email_id;
cout<<endl<<"Birth date  : "<<bdate;
cout<<endl<<endl;
cout<<"Academic Information:"<<endl;
cout<<"______________________________________________"<<endl;
cout<<endl<<"10th Percentage: "<<tenth<<"%";
cout<<endl<<"12th Percentage: "<<twelth<<"%";
cout<<endl<<"Class          : "<<Class;
cout<<endl<<endl;
cout<<endl<<"Declaration: "<<endl;
cout<<"______________________________________________"<<endl;
cout<<endl<<"\tI hereby declare that the above details are best to my knowledge.";
cout<<endl<<endl<<"Yours Sincerely,";
cout<<endl<<name<<".";
}
};//End of Biodata class

int main()
{
biodata b;
clrscr();
b.getdata();
b.get_result();
b.print();
getch();
return 0;
}

Post a Comment

Previous Post Next Post