//Prg to keep record of books & Audio Cassetes
//Downloaded From www.c4cpp.co.nr
//(C)2009.All rights reserved.
#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<stdio.h>
class publication
{
char title[20];
float price;
public:
void getdata()
{
cout<<"Enter Title"<<endl;
gets(title);
cout<<"Enter Price"<<endl;
cin>>price;
}
void putdata()
{
cout<<"Title"<<endl;
puts(title);
cout<<"Price"<<endl;
cout<<price;
}};
class book : protected publication
{
int pagecount;
public:
void putdata()
{
publication :: putdata();
cout<<endl<<"Pg Count"<<endl;
cout<<pagecount;
}
void getdata()
{
publication::getdata();
cout<<"Pg Count"<<endl;
cin>>pagecount;
}
};
class tape : protected publication
{
float time;
public:
void getdata()
{
publication :: getdata();
cout<<"Enter Time"<<endl;
cin>>time;
}
void putdata()
{
publication :: putdata();
cout<<endl<<"Time "<<endl;
cout<<time;
}
};
void main()
{
clrscr();
book b;
tape t;
int ch;
x:
{
cout<<endl<<"1. BOOK 2:Tape 3:Exit "<<endl;
cin>>ch;
switch(ch)
{
case 1:b.getdata();
b.putdata();
goto x;
case 2:t.getdata();
t.putdata();
goto x;
case 3:exit(0);
}
}
getch();
}
Programs Can Also Be Downloaded From The Folders Below....[Or Scroll Down]
Publications ( Classes )
Click Here To Download C++ File Of This Program
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment