补c++第五次作业
来源:互联网 发布:联通ssr免流端口2017 编辑:程序博客网 时间:2024/05/21 21:01
/* 文件名称:Ex5-1.cpp
* 作 者:包裕波
* 完成日期:2017 年 5 月 8日
* 版 本 号:cb v1.25.0
* 对任务及求解方法的描述部分:
* 输入描述:无
* 问题描述:
* 程序输出:略
* 问题分析:略
* 算法设计:略 */
#include<iostream>
#include<string>
using namespace std;
class Book
{
public:
void setbook(string ,string ,string ,double ,int ,int );
void borrow();
void restore();
void print();
void set_No();
void get_No();
void numb();
private:
string name;
string writer;
string publicer;
double price;
int number;
int No;
};
void Book::setbook(string _name,string _writer,string _publicer,double _price, int _number,int _No)
{
name=_name;
writer=_writer;
publicer=_publicer;
price=_price;
number=_number;
No=_No;
}
void Book::borrow()
{
number--;
}
void Book::restore()
{
number++;
}
void Book::print()
{
cout<<"书名: "<<name<<endl;
cout<<"作者: "<<writer<<endl;
cout<<"出版社: "<<publicer<<endl;
cout<<"价格: "<<price<<endl;
cout<<"数量: "<<number<<endl;
cout<<"书号: "<<No<<endl;
}
int main()
{
Book NO;
NO.setbook("honggaoliang","moyan","beijingchubanshe",25,10,1);
NO.print();
NO.borrow();
return 0;
}
* 作 者:包裕波
* 完成日期:2017 年 5 月 8日
* 版 本 号:cb v1.25.0
* 对任务及求解方法的描述部分:
* 输入描述:无
* 问题描述:
* 程序输出:略
* 问题分析:略
* 算法设计:略 */
#include<iostream>
#include<string>
using namespace std;
class Book
{
public:
void setbook(string ,string ,string ,double ,int ,int );
void borrow();
void restore();
void print();
void set_No();
void get_No();
void numb();
private:
string name;
string writer;
string publicer;
double price;
int number;
int No;
};
void Book::setbook(string _name,string _writer,string _publicer,double _price, int _number,int _No)
{
name=_name;
writer=_writer;
publicer=_publicer;
price=_price;
number=_number;
No=_No;
}
void Book::borrow()
{
number--;
}
void Book::restore()
{
number++;
}
void Book::print()
{
cout<<"书名: "<<name<<endl;
cout<<"作者: "<<writer<<endl;
cout<<"出版社: "<<publicer<<endl;
cout<<"价格: "<<price<<endl;
cout<<"数量: "<<number<<endl;
cout<<"书号: "<<No<<endl;
}
int main()
{
Book NO;
NO.setbook("honggaoliang","moyan","beijingchubanshe",25,10,1);
NO.print();
NO.borrow();
return 0;
}
0 0
- 补C++第五次作业
- 补c++第五次作业
- c++-第五次作业
- 第五次C ++作业
- 补作业 第五次实验 项目5
- 补作业 第五次实验 项目4
- C++第五次作业(补)
- 第五次作业C语言
- C语言第五次作业练习
- 第五次作业
- 第五次作业
- 第五次作业
- 第五次作业
- 第五次作业
- 第五次作业
- 第五次作业
- 第五次作业
- 第五次课后作业
- MPICH2服务器集群简单的安装配置总结
- 接口篇(5.6) 01. 内网接口的拆分 ❀ 飞塔 (Fortinet) 防火墙
- properties元素
- 阿里百川HotFix 接入问题记录
- 第二行代码学习笔记之第一章
- 补c++第五次作业
- 深入Android渲染机制
- qcom DeviceTree
- 上传Excel数据导入到数据库
- 互联网帝国腾讯的成功因子----读《腾讯传》有感
- RecyclerView的条目监听事件
- 30岁后程序员应该进行怎样的职业转型?
- CSS清除浮动方法
- 很好用的数据库工具---EZDML