- 博客(20)
- 收藏
- 关注
原创 复习C++
一、实验目的 复习巩固VC编程环境的使用,以及C++模板设计。 1.回顾并掌握VC单文件结构程序设计过程。 2.回顾并掌握VC多文件工程设计过程 3.掌握VC程序调试过程。 4.回顾C++模板和模板的程序设计。 二、实验内容 1. 设计一个单文件结构程序完成从键盘输入两个数,输出二者的“和”和“积”的结果。要求如下: 1)设计函数来计算
2015-10-02 11:39:26 344
原创 课程设计.图书信息管理系统
/****************库函数的调用************************************/ #include #include #include #include using namespace std; /**********************定义全局变量****************************/ #define N 100 //宏替
2015-07-07 08:10:24 954
原创 7.12流插入运算符“<<"和流提取运算符”>>“
#include #include using namespace std; class Matrix{ private: int var[2][4]; public: Matrix(); //构造函数 friend Matrix operator+(Matrix& a, Matrix& b); //加法友元函数 friend
2015-06-27 17:37:30 532
原创 7.9成员函数重载运算符
#include #include using namespace std; class array{ private: int var[2][3]; public: array(); //构造函数 array(int a,int b,int c,int d,int e,int f); /
2015-06-27 15:41:13 686
原创 7.10友元函数重载运算符
#include #include using namespace std; class array{ private: int var[2][3]; public: array(); array(int a,int b,int c,int d,int e,int f); //构造函数 void get();
2015-06-27 11:03:06 402
原创 6.14纯虚数的派生类
#include #include using namespace std; class container{ //声明抽象类container protected: double radius; public: container(double radius1); //构造函数 virtual double surfa
2015-06-26 21:09:35 433
原创 6.13
#include using namespace std; class Bace{ //基类 protected: double h; public: Bace(double a) { h=a; } virtual void disp() { cout<<"High="<<h<<endl; } }; class Cuboid :public Bace{
2015-06-09 22:27:38 331
原创 5.19
#include #include using namespace std; class bace { private: string name; int age; public: bace(string a,int b) { name=a; age=b; } void show() { cout<<"姓名:"<<name<<endl; cout<<"年龄:"<<a
2015-06-05 19:33:36 262
原创 5.18
#include #include using namespace std; class person{ public: person(int a,string b) //构造函数 { num=a; name=b; } void show() //显示函数 { cout<<"number:"<<num<<endl; cout<<"name:"<<name<
2015-06-05 16:58:37 301
原创 4.22两点之间的距离
#include #include using namespace std; class dot{ public: dot(float a,float b) { x=a; y=b; } void show(dot& j,dot& k) { cout<<"A点的坐标为:("<<j.x<<","<<j.y<<")"<<endl; cout<<"B点的坐标为:("<<k.x<<
2015-06-04 22:24:59 319
原创 4.21静态算出人数与平均成绩
#include #include using namespace std; class student{ public: student(string number,string name,float score); void show(); void show_count_sum_ave(); private: string number; string name; float s
2015-06-04 22:23:29 517
原创 4.20
#include using namespace std; class book{ public: book(int a) { qu=a; price=a*10; } void display(); private: int qu; int price; }; void book::display() { cout<<qu*price<<endl; } int mai
2015-05-03 23:50:52 307 1
原创 4.19
#include using namespace std; class book{ public: book(int a) { qu=a; price=a*10; } void display(); private: int qu; int price; }; void book::display() { cout<<qu*price<<endl; } int mai
2015-05-03 23:25:41 362 1
原创 4.18
#include using namespace std; class student{ public: student(int a,int b) { number=a; performance=b; } void display(); void Max(student *p); private: int number; int performance; }; void s
2015-05-03 22:07:09 334 1
原创 4.17
#include using namespace std; class student{ public: student(int a,int b) { number=a; performance=b; } void display(); private: int number; int performance; }; void student::display() { cou
2015-05-03 21:02:33 359 1
原创 2.28
#include #include int main() { int x,y,z; cout<<"请输入底数:"; cin>>x; cout<<"请输入指数:"; cin>>y; z=pow(x,y); cout<<"结果为:"<<z<<endl; return 0 }
2015-04-13 21:41:11 445 1
原创 81页第二题设计魔方
#include #include using namespace std; class magic { public: void getdate(); //输入初值成员函数 void setfirstmagic(); //设置初始魔方成员函数 void generatemagic(); //生成最终魔方成员函数 void printma
2015-04-13 18:18:05 448 1
原创 3.24
#include using namespace std; class Date{ private: int year; int month; int day; public: Date(int Y,int m,int d); Date(); Date(const Date& d) { year=d.year+1; month=d.month; day=d.day;
2015-04-12 22:02:19 320 1
原创 3.23
#include using namespace std; const double PI=3.14; class cylinder{ public: cylinder(double x,double y) { radius=x; high=y; } double calcu(); void vol(); private: double radius,high; }; void
2015-04-12 21:58:21 394 1
原创 3.22
#include using namespace std; const double PI=3.14; class Circle{ public: double area() { return PI*radius*radius;} void input(); void display(); private: double radius; }; void Circle::i
2015-04-12 21:52:39 330 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人