自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(47)
  • 收藏
  • 关注

原创 这十月,与C++代码相伴的日子

敲代码。

2012-06-11 19:15:38 860

原创 第十六周实验报告(1)

/* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生* All rights reserved.* 文件名称:设计一个工资类(Salary)--完成各个功能#include#includeusing namespace std;int main(){ float a[500];

2012-06-04 18:08:46 531

原创 第十四周实验报告(3)

3

2012-05-21 18:03:59 476 1

原创 第十四周实验报告(2)

2

2012-05-21 18:03:51 807 1

原创 第十四周实验报告(1)

【任务1】建立专门的数组类处理有关数组的操作数组是几乎所支持的组织数据的方法。C和C++对数组类型提供了内置支持,使我们利用数组实现软件中需要的各种实用的功能。但是,这种支持仅限于用来读写单个元素的机制。C++不支持数组的抽象abstraction,也不支持对整个数组的操作。例如:把一个数组赋值给另外一个数组,对两个数组进行相等比较或者想知道数组的大小size,等等。对C++而言,数组是从C语言中

2012-05-21 18:03:39 369

原创 第十三周实验报告(4)

程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2012. 烟台大学计算机学院学生 * All rights reserved.* 文件名称:* 作    者:         程龙                * 完成日期:     2012    年 05      月  18  日* 版 本 号:         * 对任务

2012-05-20 13:47:09 719

原创 第十三周实验报告(3)

/* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:* 作    者:        程龙                    * 完成日期:     2012    年 05      月  18 日* 版 本 号:

2012-05-20 13:46:58 560

原创 第十三周实验报告(2)

2

2012-05-20 13:46:44 502

原创 第十三周实验报告(1)

* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生                       * 作    者:   计114-4  程龙     * 完成日期:    2012  年   5    月    18  日任务1.2#include using namespace std;class Vehicle

2012-05-20 13:46:27 564

原创 第十二周实验报告(4)

/** 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:                              * 作    者:   程龙                              * 完成日期:   2012  年  5  月  8  日* 对任务及求解方法的描

2012-05-10 12:22:46 667

原创 第十二周实验报告(3)

/** 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:                              * 作    者:   程龙                              * 完成日期:   2012  年  5  月  8  日* 对任务及求解方法的描

2012-05-10 12:22:29 880

原创 第十二周实验报告(2)

/** 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:                              * 作    者:   程龙                              * 完成日期:   2012  年  5  月  8  日* 对任务及求解方法的描

2012-05-10 12:22:18 495

原创 第十二周实验报告(1)

/** 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:                              * 作    者:   程龙                              * 完成日期:   2012  年  5  月  8  日* 对任务及求解方法的描

2012-05-10 12:22:06 456

原创 第十周实验报告(3)

【任务3】(1)先建立一个Point(点)类,包含数据成员x,y(坐标点);(2)以Point为基类,派生出一个Circle(圆)类,增加数据成员 (半径);(3)再以Circle类为直接基类,派生出一个Cylinder(圆柱体)类,再增加数据成员h(高)。要求编写程序,设计出各类中基本的成员函数(包括构造函数、析构函数、修改数据成员和获取数据成员的公共接口、用于输出的重载运算符“

2012-04-23 19:06:32 550

原创 第十周实验报告(2)

【任务2】定义一个名为CPerson的类,有以下私有成员:姓名、身份证号、性别和年龄,成员函数:构造函数、析构函数、输出信息的函数。并在此基础上派生出CEmployee类,派生类CEmployee增加了两个新的数据成员,分别用于表示部门和薪水。要求派生类CEmployee的构造函数显示调用基类CPerson的构造函数,并为派生类CEmployee定义析构函数,定义输出信息的函数。#in

2012-04-23 18:59:16 533

原创 第十周实验报告(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 444 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 458

原创 第九周实验报告(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 319

原创 第九周实验报告(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 358

原创 第九周实验报告(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 533

原创 第九周实验报告(1)

#include class CTime { private: unsigned short int hour; // 时 unsigned short int minute; // 分 unsigned short int second; // 秒

2012-04-17 21:30:49 251

原创 第八周实验报告(3)

3

2012-04-16 17:43:18 238

原创 第八周实验报告(2)

2

2012-04-16 17:43:07 245

原创 第八周实验报告(1)

1

2012-04-16 17:42:57 224

原创 第七周实验报告(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 459 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 291

原创 第七周实验报告(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 253

原创 第六周实验报告(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 434 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 462

原创 第六周实验报告(2)

1

2012-03-27 20:27:04 419

原创 第六周实验报告(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 301

原创 第五周实验报告(四)

#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 250

原创 第五周实验报告(三)

#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 273

原创 第五周实验报告(二)

#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 249

原创 第五周实验报告(一)

/* (程序头部注释开始)* 程序的版权和版本声明部分* Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved.* 文件名称:                              * 作    者:                          程龙    * 完成日期:         年 3      月

2012-03-19 21:58:51 500 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 417 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 392

原创 第四周实验报告(2)

1

2012-03-12 21:50:42 245

原创 第四周实验报告(1)

/* (程序头部注释开始) * 程序的版权和版本声明部分 * Copyright (c) 2011, 烟台大学计算机学院学生  * All rights reserved. * 文件名称:   Triangle.cpp                            * 作    者:   计114-4 程龙            * 完成日期:   2012 年

2012-03-12 21:50:16 270

原创 第三周实验报告(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 326

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除