银行储蓄系统 /* *版权所有:Copyright (c)2015,烟台大学计算机与控制工程学院 *All rights reserved. * *文件名称:bank.h *文件标识:无 *内容摘要:该代码用于获取满足后缀要求的第一个文件 *其他说明:无 *当前版本:V1.0 *作 者:李明宇 *完成日期:2015年7月16日 * *修改记录: *修改日期:无 *版本号:V1.0 *修改人:李明宇 *修改
十二周项目2 #include #include #include using namespace std; enum vehicleStaus {rest, running}; //车辆状态:泊车、行进 class vehicle //车辆类 { protected: int maxSpeed; //最大车速 int currentSpeed; //当前速度 int weigh
十二周项目一 #include #include using namespace std; class Teacher { public: Teacher(string na,int a,char s,string ti,string ad,string t):name(na),age(a),sex(s),title(ti),addr(ad),tel(t){ } void display();
第八周项目一-实现复数类中的运算符重载 #include using namespace std; class Complex { public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r; imag=i;} Complex operator+(const Complex &c2); Complex operator-(con
第六周项目二我的数组类 #include using namespace std; class MyArray { private: int *arrayAddr; //保存一个有len个整型元素的数组的首地址 int len; //记录动态数组的长度 int max; //动态数组中的最大值(并非动态数组中必须要的数据成员) public: MyArray(int
第六周项目一深复制(3) #include #include using namespace std; class A { private: char *a; public: A(char *aa) { a = new char[strlen(aa)+1]; //(a)这样处理的意义在于:_ 保存字符串中的'/n' strcpy(a, aa); //(b)数据成员
第六周项目一深复制 #include #include using namespace std; class A { private: char *a; public: A(char *aa) { a = new char[strlen(aa)+1]; //(a)这样处理的意义在于:_ 保存字符串中的'/n' strcpy(a, aa);
第五周项目一 体验常成员函数 #include #include using namespace std; class CPoint { private: double x; // 横坐标 double y; // 纵坐标 public: CPoint(double xx=0,double yy=0); double Distance1(CPoint p) const;
第五周项目程序阅读一 #include using namespace std; class base { private : int m ; public : base () {}; base(int m){this->m=m;} int get () {return m;} void set (int m){this->m=m;} };//
第3周项目5数组作数据成员 #include using namespace std; class Salary { private: double salarys[50]; int number; public: void set_salarys(); void add_salarys(int x); void sort_salarys
第3周项目4考了语文数学的学生 #include #include using namespace std; class Stu { private: string name; //学生姓名 float chinese; //语文成绩 float math; //数学成绩 //接下去写 public: void setStuden
第3周项目2三角形类2 #include #include using namespace std; class Triangle { public: void setA(double x) { a=x; }; void setB(double y) { b=y; }; vo
第3周项目1三角形类1 #include #include #include using namespace std; class Triangle { public: void setABC(double x, double y, double z);//置三边的值,注意要能成三角形 void getABC(double *x, double *y, double *z)
试验 class Time { public: Time( ); Time(int h,int m=0,int s=0); void show_time( ); private: int hour; int minute; int sec; }; Time::Time( ) : hour(0), minute(0), sec(0){ } Time:
17-1体会函数参数 #include using namespace std; void fun1(int &x,int &y); void fun2(int *x, int *y); int main() { int a,b; a=11; b=22; fun2(&a,&b); cout<<"a="<<a<<" b="<<b<<endl
引用作形参 #include using namespace std; void f1(int *x,int *y,int *z); void f2(int &x,int &y,int &z); int main() { int a,b,c; cin>>a>>b>>c; f1(&a,&b,&c); cout<<"降序排列为:"<<a<
17-3胖子伤不起 #include using namespace std; struct people { char name[20]; char sex; double height; double weight; }; int main() { double z,b; people p; cin
17-4生日差几天 #include using namespace std; struct Date { int year; int month; int day; }; int main() { Date date,time; cout<<"第一人的生日为:"; cin>>date.year>>date.month>
16-4动态数组扩容 #include using namespace std; int main( ) { int num,i,addNum; //num是小组人数 cout<<"输入学生人数: "; cin>>num; int *score = new int[num]; cout<<"请输入学生成绩: "<<endl;
16-3函数指针调用 #include using namespace std; void eat(); void sleep(); void hitdoudou(); void run(void (*f)()); int main() { int iChoice; do { cout<<"请选择(1-吃;2-睡;3-打;其他