
课内实验题练习
内容为学校里面老师布置的实验练习题而整理出来的实验报告。
?Suki
你终究会成为你正在成为的人,你的每一个选择都是来自你人生意义的诘问。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Mystring类!!!(对字符串来次大复习)
Experiment topic 2自定义字符串类示例程序:#include<iostream>using namespace std;const int n=256;class mystring{ char str[n]; //存放字符串的数组容器,可考虑定义指针,在构造函数中动态分配空间 int maxsize; //最大可用元素数,可防止...原创 2020-05-04 04:40:14 · 1345 阅读 · 0 评论 -
给出学生信息以类形式定义的链表的编程:
[Experiment topic 3]**class Student//学生结点类{long no;char *name;int score;Student link;public:Student(long nno,char nn="",int score1=0,Student next=NULL){name=new char[strlen(nn)+1];no=nno;sc...原创 2020-04-14 01:09:08 · 664 阅读 · 0 评论 -
简单文件输入/输出 C++(实验报告)(2)
[Experiment topic 2]用编辑器(记事本等)产生一个文本文件data.txt,其内容为若干实数,数据之间以空白字符分割。编程从该文件中读入这些实数,求出这些实数的平均值,在程序中创建并产生一个文本文件result.txt,内容为data.txt中的全体实数,每行5个数,最后一行是求出的平均值。 Experimental procedure#include<iostream>#include<fstream> //file I/O support#inclu原创 2020-05-22 04:08:06 · 2362 阅读 · 0 评论 -
简单文件输入/输出 C++(实验报告)(1)
熟练掌握用程序直接读取文件中的数据而不是手工输入。Master how to use program to read the data in the file directly instead of inputting manually.学会让程序将输出写入到文件从而得到有关结果的永久性记录。Learn to have the program write output to a file to get a permanent record of the results.[Experiment t.原创 2020-05-22 03:56:32 · 1411 阅读 · 0 评论 -
运算符重载实验(超基础和干货的代码训练)
T1.Purpose of the experimentMaster the basic syntax of operator overloading.Skillfully use the function with the same name to complete the same basic operation.T2.Experiment content[Experiment top...原创 2020-05-02 02:57:07 · 601 阅读 · 0 评论 -
类的运行时多态(一次实验作业)
T1.Purpose of the experimentMaster the writing grammar of pure virtual function; Be able to construct an abstract class skillfully; Skillfully use virtualfunction to realize polymorphism. Remember ...原创 2020-04-27 23:52:26 · 673 阅读 · 0 评论 -
有关派生类的一次实验作业
以点(point)类为基类(不必和上题点类完全一致),定义派生类:矩形类和圆类。点为直角坐标点,矩形水平放置,由左下方的顶点和长宽定义。圆有圆心和半径定义。派生类操作判断任一坐标点是在图形内,在图形的边缘上,还是在图形外。默认初始化图形退化为点。要求包括拷贝构造函数。编程测试类是否正确。1. Experimental procedure#include<iostream>...原创 2020-04-14 01:00:31 · 926 阅读 · 0 评论 -
对类的静态成员概念的理解掌握的一次实验作业
[Experiment topic 1]定义一个点类,如下:class Point{int x,y;static int countp;//统计点对象个数public:Point(int x=1,int y=1);void Setxy(int xx,int yy);void Getxy(int &xx,int &yy);//引用参数有什么作用?static in...原创 2020-04-14 00:47:17 · 510 阅读 · 0 评论