#ifndef _BOOK_H
#define _BOOK_H
#include<iostream.h>
class Book
{
public:
char isbn[20];
char title[40];
char author[20];
char publishcompany[40];
float price;
public:
Book(char *Isbn,char *Title,char *Author,char *Publishcompany,float Price);
~Book();
void setisbn(char *Isbn);
void settitle(char *Title);
void setauthor(char *Author);
void setpublishcompany(char *Publishcompany);
void setprice(float Price);
char *getisbn(){ return isbn;}
char *gettitle(){ return title;}
char *getauthor(){ return author;}
char *getcompany(){ return publishcompany;}
};
#endif
#include"Book.h"
#include<string.h>
Book::Book(char *Isbn,char *Title,char *Author,char *Publishcompany,float Price)
{
strcpy(isbn,Isbn);
strcpy(title,Title);
strcpy(author,Author);
strcpy(publishcompany,Publishcompany);
price = Price;
}
void Book::setisbn(char *Isbn)
{
strcpy(isbn,Isbn);
}
void Book::settitle(char *Title)
{
strcpy(title,Title);
}
void Book::setauthor(char *Author)
{
strcpy(author,Author);
}
void Book::setpublishcompany(char *Publishcompany)
{
strcpy(publishcompany,Publishcompany);
}
void Book::setprice(float Price)
{
price = Price;
}
void main()
{
Book a(7-81012-578-8,c,weiwei,wwiilla,25.00);
}
Ϊʲô³ö´íÁË£¿£¿