
January 30th, 2004, 07:43 AM
|
|
Authorized User
|
|
Join Date: Jan 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by amahja56
CHANGE THE CODE AS FOLLOWS
# include <iostream.h>
# include <conio.h>
class card
{
private:
char book;
int author;
int nocopies;
public:
void store();
void show();
};
void card::store()
{
cout<<"enter book title:";
cin>>book;
cout<<" nenter the author's name:";
cin>>author;
cout<<" nenter the number of copies:";
cin>>nocopies;
}
void card::show()
{
cout<<"\nthe book title is:"<<book;
cout<<"\nthe athor's name is:"<<author;
cout<<"\nthe number od copies are:"<<nocopies;
}
int main()
{
card my_book;
my_book.store();
my_book.show();
getch();
}
|
|