1.
#include "stdafx.h"
2.
#include //strcpy() uchun
3.
#include //printf() uchun
4.
#include //_getch() uchun
5.
using namespace std;
6.
class book_series{
7.
public:
8.
book_series(char *, char *, float);
9.
void show_book(void); void set_pages(int);
10.
private:
11.
static int page_count; /*bu umumiy elеmеnt hisoblanadi*/
12.
char title[64]; char author[64];
13.
float price; };
14.
int book_series::page_count; /*sinfdan tashaoidaumumiy
o‘zgaruvchini e`lon qilish*/
15.
void book_series::set_pages(int pages){
16.
page_count = pages; }
17.
book_series::book_series(char *title, char *author, float price){
/*Sinfning konstruktori*/
18.
strcpy(book_series::title, title); /*string sinfiga ulanish uchun
zarur bo‘lgan, strcpy() funksiyasi*/
19.
strcpy(book_series::author, author);
20.
book_series::price = price; }
21.
void book_series:: show_book (void){
22.
Do'stlaringiz bilan baham: |