摘要: Part 2 #include <iostream> #include <fstream> #include <string> #include <cstdlib> using namespace std; int main() { string filename1, filename2, newf 阅读全文
posted @ 2019-06-18 10:18 GeorgeWan 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 1 #include"petcats.h" 2 #include"petdogs.h" 3 #include"machinepets.h" 4 #include<iostream> 5 #include<string> 6 using namespace std; 7 8 void play(Mac 阅读全文
posted @ 2019-06-03 16:25 GeorgeWan 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 1. 车辆基本信息管理 问题场景描述如下:为了对车量基本信息进行管理,对现实世界车量基本信息抽象后,抽象出Car类、ElectricCar类、Battery类,它们之间的关系描述如下:基于Car类派生出ElectricCar类,派生类ElectricCar中新增数据成员为Battery类对象。 #i 阅读全文
posted @ 2019-05-20 08:55 GeorgeWan 阅读(107) 评论(1) 推荐(0) 编辑
摘要: 1. date.cpp utils.h utils.cpp 阅读全文
posted @ 2019-04-30 15:10 GeorgeWan 阅读(104) 评论(0) 推荐(0) 编辑
摘要: graph.cpp: #include "graph.h" #include <iostream> using namespace std; Graph::Graph(char ch, int n): symbol(ch), size(n) { } void Graph::draw() { int 阅读全文
posted @ 2019-04-22 08:06 GeorgeWan 阅读(97) 评论(2) 推荐(0) 编辑
摘要: 实验要求: 定义一个复数类Complex,使得下面的代码能够工作: Complex c1(3,5); //用复数3+5i初始化c1; Compex c2=4.5; //用实数4.5初始化c2 c1.add(c2); //将c1与c2相加,结果保存在1中 c1.show(); //将c1输出(这时的结 阅读全文
posted @ 2019-03-31 13:28 GeorgeWan 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 编写重载函数add(),实现对int型,double型,Complex型数据的加法。在main()函数中定义不同类型 数据,调用测试。 编写实现快速排序函数模板,并在main()函数中,定义不同类型数据,调用测试。 #include <iostream>using namespace std;tem 阅读全文
posted @ 2019-03-23 15:48 GeorgeWan 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int main() { char a; cout<<"Menu:A(dd) D(elete) S(ort) Q(uit),Select one:"<<endl; cin>>a; while(a) { if(a=='A' 阅读全文
posted @ 2019-03-17 10:56 GeorgeWan 阅读(174) 评论(1) 推荐(0) 编辑