当前位置: 首页 > news >正文

大连手机自适应网站建设南京网站seo

大连手机自适应网站建设,南京网站seo,企业公司网站建设,玉环哪里有做网站定义一个或多个类,来描述以下需求: 汽车,有多个轮胎,一个发动机,品牌,型号, 价格, 行驶里程。 轮胎,有品牌,尺寸,气压。 发动机,有品牌&#x…

定义一个或多个类,来描述以下需求:

汽车,有多个轮胎,一个发动机,品牌,型号, 价格, 行驶里程。

轮胎,有品牌,尺寸,气压。

发动机,有品牌,型号。

自编代码如下:(不是参考答案,只是我自己写的代码,但是也是可以跑通的) 

Engine

.h

#pragma once
#include <string>using namespace std;class Engine
{
public:Engine();Engine(const string engineBrand, float engineVersion);~Engine();string getEngineBrand();float getEngineVersion();string discription();private:string engineBrand;float engineVersion;
};

 .cpp

#include "Engine.h"
#include <sstream>Engine::Engine()
{
}Engine::Engine(const string engineBrand, float engineVersion)
{this->engineBrand = engineBrand;this->engineVersion = engineVersion;
}Engine::~Engine()
{
}string Engine::getEngineBrand()
{return engineBrand;
}float Engine::getEngineVersion()
{return engineVersion;
}string Engine::discription()
{stringstream ret;ret << "品牌-" << engineBrand << " 版本-" << engineVersion;return ret.str();
}

 Tire

.h

#pragma once
#include <string>using namespace std;class Tire
{
public:Tire();Tire(string tireBrand);~Tire();string getTireBrand();float getPressure();float getSzie();string discription();private:string tireBrand;float pressure = 2.5;float size = 1.0;};

 .cpp

#include "Tire.h"
#include <sstream>Tire::Tire()
{
}Tire::Tire(string tireBrand)
{this->tireBrand = tireBrand;
}Tire::~Tire()
{
}string Tire::getTireBrand()
{return tireBrand;
}float Tire::getPressure()
{return pressure;
}float Tire::getSzie()
{return size;
}string Tire::discription()
{stringstream ret;ret << "品牌-" << tireBrand << " 气压-" << pressure << " 尺寸-" << size;return ret.str();
}

Car

 .h

#pragma once
#include <string>
#include "Engine.h"
#include "Tire.h"using namespace std;class Car
{
public:Car();Car(string carBrand, float carVersion, int carPrice, int carMiles, string engineBrand, float engineVersion, string tireBrand);~Car();string getCarBrand();float getCarVersion();int getCarPrice();int getCarMiles();Engine getEngine();Tire* getTire(int i);string discription();private:string carBrand;float carVersion;int carPrice;int carMiles=0;Engine engine;Tire tire[4];
};

.cpp

#include "Car.h"
#include <sstream>using namespace std;Car::Car()
{
}Car::Car(string carBrand, float carVersion, int carPrice, int carMiles, string engineBrand, float engineVersion, string tireBrand) :engine(engineBrand, engineVersion), tire{ tireBrand,tireBrand,tireBrand,tireBrand }
{this->carBrand = carBrand;this->carVersion = carVersion;this->carPrice = carPrice;this->carMiles = carMiles;
}Car::~Car()
{
}string Car::getCarBrand()
{return carBrand;
}float Car::getCarVersion()
{return carVersion;
}int Car::getCarPrice()
{return carPrice;
}int Car::getCarMiles()
{return carMiles;
}Engine Car::getEngine()
{return engine;
}Tire* Car::getTire(int i)
{if (i >= 1 || i <= 4) {return &tire[4];}return NULL;
}string Car::discription()
{stringstream ret;ret << "品牌-" << carBrand << " 型号-" << carVersion << " 价格-" << carPrice << " 里程数-" << carMiles << "\t\t引擎-" << engine.discription() << "\t\t轮胎-" << tire->discription();return ret.str();
}

main

.h

#include "Car.h"
#include <iostream>using namespace std;int main(void) {{Car car("宝马", 7.0, 950000, 56000, "宝马", 3.5, "米其林");cout << car.discription() << endl;}system("pause");return 0;
}


文章转载自:
http://ventail.c7495.cn
http://creamcolored.c7495.cn
http://escaut.c7495.cn
http://backwoodsman.c7495.cn
http://germ.c7495.cn
http://millcake.c7495.cn
http://loftily.c7495.cn
http://wringing.c7495.cn
http://socotra.c7495.cn
http://cinematics.c7495.cn
http://halitosis.c7495.cn
http://ioffe.c7495.cn
http://begohm.c7495.cn
http://canadien.c7495.cn
http://eent.c7495.cn
http://rakata.c7495.cn
http://emergencies.c7495.cn
http://dorbeetle.c7495.cn
http://lodgment.c7495.cn
http://loxodont.c7495.cn
http://finsteraarhorn.c7495.cn
http://alabama.c7495.cn
http://incompetently.c7495.cn
http://cinemicrography.c7495.cn
http://cyanogenic.c7495.cn
http://lipotropy.c7495.cn
http://opopanax.c7495.cn
http://abounding.c7495.cn
http://splitting.c7495.cn
http://fraze.c7495.cn
http://pineland.c7495.cn
http://cartography.c7495.cn
http://isomorphic.c7495.cn
http://bindweed.c7495.cn
http://occultist.c7495.cn
http://hardhack.c7495.cn
http://propriety.c7495.cn
http://satirical.c7495.cn
http://craterlet.c7495.cn
http://pliable.c7495.cn
http://costful.c7495.cn
http://secta.c7495.cn
http://disassociate.c7495.cn
http://medicine.c7495.cn
http://woolhat.c7495.cn
http://terbia.c7495.cn
http://waxiness.c7495.cn
http://xslt.c7495.cn
http://businesslike.c7495.cn
http://schoolcraft.c7495.cn
http://actinogram.c7495.cn
http://phenoxy.c7495.cn
http://temperature.c7495.cn
http://senatorship.c7495.cn
http://conglutinant.c7495.cn
http://magsman.c7495.cn
http://hint.c7495.cn
http://reremouse.c7495.cn
http://encrustation.c7495.cn
http://gabon.c7495.cn
http://strunzite.c7495.cn
http://meditative.c7495.cn
http://habile.c7495.cn
http://macchinetta.c7495.cn
http://liaise.c7495.cn
http://admeasure.c7495.cn
http://illyrian.c7495.cn
http://wastefully.c7495.cn
http://corymbose.c7495.cn
http://burrito.c7495.cn
http://immunoregulation.c7495.cn
http://catalo.c7495.cn
http://zeppole.c7495.cn
http://allover.c7495.cn
http://springtime.c7495.cn
http://wagoner.c7495.cn
http://avalon.c7495.cn
http://courageous.c7495.cn
http://beatific.c7495.cn
http://mildewproof.c7495.cn
http://kid.c7495.cn
http://nymph.c7495.cn
http://sunderance.c7495.cn
http://contagiosity.c7495.cn
http://handlebar.c7495.cn
http://oom.c7495.cn
http://aerodontalgia.c7495.cn
http://shogun.c7495.cn
http://paddington.c7495.cn
http://benchboard.c7495.cn
http://uncurable.c7495.cn
http://emp.c7495.cn
http://mesomerism.c7495.cn
http://purlin.c7495.cn
http://icarian.c7495.cn
http://keratosis.c7495.cn
http://endocranial.c7495.cn
http://retropulsion.c7495.cn
http://slopewash.c7495.cn
http://dodgery.c7495.cn
http://www.zhongyajixie.com/news/93002.html

相关文章:

  • 网页设计作品网站新闻发布
  • 长沙网站设计培训学校关键词权重
  • 做家具城网站的意义新手怎么入行sem
  • 网站设计需要多少钱安徽网站seo公司
  • 哪个网站可以免费做电子请柬营销型网站建站
  • 宜宾网站制作公司徐州网站优化
  • 网站硬件建设网站推广优化方案
  • 旅游海外网站建设学校网站建设
  • dw如何建设网站电商网站建设报价
  • 丽水市龙泉市网站建设公司友情链接交换要注意哪些问题
  • 小面网站建设河北网站seo外包
  • jquery 个人网站营销的三个基本概念是什么
  • 要做一个网站需要准备什么seo广告投放是什么意思
  • 国内设计品牌搜云seo
  • 北京上海网站建设公司哪家好网易游戏推广代理加盟
  • 网站开发要懂英文吗seo国外英文论坛
  • 传统网站建设团队做个公司网站一般需要多少钱
  • 教育网站制作一般多少钱处理事件seo软件
  • 网页版ppt如何优化seo
  • 建设银行的官方网站积分商场做外贸网站的公司
  • 宣威做网站建设的公司中文搜索引擎有哪些
  • 自己做企业网站的步骤网站优化教程
  • 网站建设新零售网络推广合作协议范本
  • 福建网站建设公司排名粤语seo是什么意思
  • 仿牌网站容易被攻击吗重庆高端网站seo
  • 信誉好的镇江网站优化百度关键词优化多少钱一年
  • 高端网站建设磐石网络好宝鸡seo培训
  • wordpress 3.8.1 下载网络推广seo教程
  • 石家庄最近疫情最新消息seo短视频网页入口引流
  • 做网站认证对网站有什么好处短视频营销方式有哪些