Package

所属分类:网络编程
开发工具:C/C++
文件大小:2KB
下载次数:4
上传日期:2019-05-19 20:58:03
上 传 者kaisaaa
说明:  设计一个Package的继承层次: 1)基类Package a) 包含寄件人姓名,收件人姓名,地址,包裹重量weight和单位重量单价price; b) 提供构造函数; c)提供计费函数double calculateCost(),根据单位重量单价和包裹重量计算并返回包裹运费; d)提供prnt函数,输出包裹基本信息和包裹运费。 2)派生类TwoDayPackage a)继承Package,并包含两日快递服务平寄费baseCost; b)重写基类的calculateCost函数,运费应在基类函数计算基础上再加上baseCost; ;
(Designing an inheritance hierarchy for a Package: 1) Base Class Package (a) Including the name of the sender, the name of the recipient, the address, the weight of the package and the unit weight price; B) Provide constructors; C) Provide the billing function double calculateCost (), calculate and return the package freight according to unit weight unit price and package weight; D) Provide PRNT function, output package basic information and package freight. 2) Derived TwoDayPackage (a) Inherit Package and include two-day express service flat delivery fee baseCost; B) To rewrite the calculateCost function of the base class, freight should be added to the calculateCost function on the basis of the calculation of the base class function. C) Rewrite the PR)

文件列表:
Package.dev (1657, 2019-05-19)
Package.layout (470, 2019-05-19)
TwoDayPackage.cpp (700, 2019-05-19)
TwoDayPackage.h (491, 2019-05-19)
Definition.h (738, 2019-05-19)
main.cpp (655, 2019-05-19)
OverNightPackage.cpp (885, 2019-05-19)
OverNightPackage.h (541, 2019-05-19)

近期下载者

相关文件


收藏者