- 博客(47)
- 收藏
- 关注
原创 第十六周实验报告(1)
/* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生* All rights reserved.* 文件名称:设计一个工资类(Salary)--完成各个功能#include#includeusing namespace std;int main(){ float a[500];
2012-06-04 18:08:46 539
原创 第十四周实验报告(1)
【任务1】建立专门的数组类处理有关数组的操作数组是几乎所支持的组织数据的方法。C和C++对数组类型提供了内置支持,使我们利用数组实现软件中需要的各种实用的功能。但是,这种支持仅限于用来读写单个元素的机制。C++不支持数组的抽象abstraction,也不支持对整个数组的操作。例如:把一个数组赋值给另外一个数组,对两个数组进行相等比较或者想知道数组的大小size,等等。对C++而言,数组是从C语言中
2012-05-21 18:03:39 372
原创 第十三周实验报告(4)
程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2012. 烟台大学计算机学院学生 * All rights reserved.* 文件名称:* 作 者: 程龙 * 完成日期: 2012 年 05 月 18 日* 版 本 号: * 对任务
2012-05-20 13:47:09 726
原创 第十三周实验报告(3)
/* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:* 作 者: 程龙 * 完成日期: 2012 年 05 月 18 日* 版 本 号:
2012-05-20 13:46:58 564
原创 第十三周实验报告(1)
* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * 作 者: 计114-4 程龙 * 完成日期: 2012 年 5 月 18 日任务1.2#include using namespace std;class Vehicle
2012-05-20 13:46:27 567
原创 第十二周实验报告(4)
/** 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称: * 作 者: 程龙 * 完成日期: 2012 年 5 月 8 日* 对任务及求解方法的描
2012-05-10 12:22:46 672
原创 第十二周实验报告(3)
/** 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称: * 作 者: 程龙 * 完成日期: 2012 年 5 月 8 日* 对任务及求解方法的描
2012-05-10 12:22:29 886
原创 第十二周实验报告(2)
/** 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称: * 作 者: 程龙 * 完成日期: 2012 年 5 月 8 日* 对任务及求解方法的描
2012-05-10 12:22:18 503
原创 第十二周实验报告(1)
/** 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称: * 作 者: 程龙 * 完成日期: 2012 年 5 月 8 日* 对任务及求解方法的描
2012-05-10 12:22:06 460
原创 第十周实验报告(3)
【任务3】(1)先建立一个Point(点)类,包含数据成员x,y(坐标点);(2)以Point为基类,派生出一个Circle(圆)类,增加数据成员 (半径);(3)再以Circle类为直接基类,派生出一个Cylinder(圆柱体)类,再增加数据成员h(高)。要求编写程序,设计出各类中基本的成员函数(包括构造函数、析构函数、修改数据成员和获取数据成员的公共接口、用于输出的重载运算符“
2012-04-23 19:06:32 553
原创 第十周实验报告(2)
【任务2】定义一个名为CPerson的类,有以下私有成员:姓名、身份证号、性别和年龄,成员函数:构造函数、析构函数、输出信息的函数。并在此基础上派生出CEmployee类,派生类CEmployee增加了两个新的数据成员,分别用于表示部门和薪水。要求派生类CEmployee的构造函数显示调用基类CPerson的构造函数,并为派生类CEmployee定义析构函数,定义输出信息的函数。#in
2012-04-23 18:59:16 541
原创 第十周实验报告(1)
【任务1】在下面一段类的定义中,需要填充的函数由注释内容给出了功能。#include #include using namespace std; class Point //定义坐标点类 {public: double x,y; //点的横坐标和纵坐标 Point(){x = 0;y = 0;} Point(double x0,
2012-04-23 18:59:02 452 1
原创 第九周实验报告(5)
#include "iostream"using namespace std;class CEquation { private: double a; // 未知数系数 double b; // 常数项 char unknown; // 未知数的符号 public: CEquation(double aa=0,doub
2012-04-17 21:52:53 461
原创 第九周实验报告(4)
#include class Douary { public: Douary(int m, int n);//构造函数:用于建立动态数组存放m行n列的二维数组(矩阵)元素,并将该数组元素初始化为 Douary(const Douary &d);//构造函数:用于建立动态数组存放m行n列的二维数组(矩阵)元素,并将该数组元素初始化为 ~Douary();
2012-04-17 21:52:43 322
原创 第九周实验报告(3)
#include #include"stdlib.h" int gcd(int m, int n); class CFraction { private: int nume; // 分子 int deno; // 分母 public: //构造函数及运算符重载的函数声明
2012-04-17 21:39:42 364
原创 第九周实验报告(2)
#include class Complex { public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex operator-(Com
2012-04-17 21:36:06 539
原创 第九周实验报告(1)
#include class CTime { private: unsigned short int hour; // 时 unsigned short int minute; // 分 unsigned short int second; // 秒
2012-04-17 21:30:49 256
原创 第七周实验报告(3)
#include using namespace std; template class Complex { public: Complex( ){real=0;imag=0;} Complex(T r,T i){real=r;imag=i;} Complex complex_add(Complex &c2);
2012-04-03 22:35:57 463 1
原创 第七周实验报告(2)
#include#includeusing namespace std;class CPoint {private: double x; // 横坐标 double y; // 纵坐标 public: CPoint(double xx=0, double yy=0):x(xx),y(yy){} double distance1(const CPoint &p);
2012-04-03 22:34:51 297
原创 第七周实验报告(1)
#include using namespace std; class Time { public: Time(int=0,int=0,int=0); void show_time( ); //根据is_24和from0,输出适合形式-20:23:5/8:23:5 pm/08:23:05 pm void add_seconds(int); //增加n秒钟
2012-04-03 21:51:23 256
原创 第六周实验报告(4)
#include #include using namespace std; class CPoint { private: double x; // 横坐标 double y; // 纵坐标 public: CPoint(double xx=0,double yy=0); double distance(CPo
2012-03-27 20:27:41 437 1
原创 第六周实验报告(3)
#include #include using namespace std; enum SymmetricStyle { axisx,axisy,point};//分别表示按x轴, y轴, 原点对称 class CPoint { private: double x; // 横坐标 double y; // 纵坐标 public:
2012-03-27 20:27:28 469
原创 第六周实验报告(1)
第一种修改方法class C {private: int x; public: C(int x) { this->x= x; } int getX() { return x; } }; void main() { C c(5); //去掉const cout<<c.getX();
2012-03-27 20:26:49 308
原创 第五周实验报告(四)
#includeusing namespace std;class Class{public: Class(int a=0,int b=0):num(a),score(b){} void show(); int put_score();private: int num; int score;};void Class::show(){ co
2012-03-19 22:04:19 254
原创 第五周实验报告(三)
#includeusing namespace std;class Box{public: Box(int len=10,int w=10,int h=10):length(len),width(w),heigth(h){} int volume(); int area(); void set_Box();private: int leng
2012-03-19 22:03:58 279
原创 第五周实验报告(二)
#include #include #include using namespace std;int gcd(int , int); class CFraction{public: CFraction(int nu=0,int de=1); void input(); void simplify(); void amplify(int n); voi
2012-03-19 22:03:31 255
原创 第五周实验报告(一)
/* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称: * 作 者: 程龙 * 完成日期: 年 3 月
2012-03-19 21:58:51 503 1
原创 第四周实验报告(4)
#include using namespace std; class Salary { public: void input_salary(); void add_salary(); void show_salary(); private: double sa
2012-03-12 21:51:02 420 1
原创 第四周实验报告(3)
#include #include using namespace std; class NaturalNumber { private: int n; public: void setValue (int x);//置数据成员n 的值,要求判断是否是正整数 int getValue(); //返回私有数据成员n 的值
2012-03-12 21:50:52 396
原创 第四周实验报告(1)
/* (程序头部注释开始) * 程序的版权和版本声明部分 * Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved. * 文件名称: Triangle.cpp * 作 者: 计114-4 程龙 * 完成日期: 2012 年
2012-03-12 21:50:16 273
原创 第三周实验报告(4)
#includeusing namespace std;class Box{ public: void get_value(); void display(); float volume(); float area(); private: float length; float width; float height; };v
2012-03-05 18:14:14 330
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人