资源简介
C++课程设计报告-科学计算器加强版,有代码有报告,可直接运行。内容详细,直接作为课程设计报告。里面的代码都有注释,可以以头文件方式植入方法函数,也可以如我给出的代码,可直接运行,无需担心。

代码片段和文件信息
/*****************************************************************************/
// complex.h: interface for the complex class.
#include
#include
#include
#include
using namespace std;
class complex
{
public:
void print();
complex();
complex(float rfloat i)
{
real= r;
image= i;
}
virtual ~complex();
friend complex operator + (complex acomplex b);
friend complex operator - (complex acomplex b);
friend complex operator * (complex acomplex b);
friend complex operator / (complex acomplex b);
private:
float image;
float real;
};
/*****************************************************************************/
// rational.h: interface for the rational class.
class rational
{
public:
void print(); //输出函数
rational(int x=0int y=0);
virtual ~rational();
friend rational operator + (rational num1rational num2); //重载运算符+
friend rational operator - (rational num1rational num2); //重载运算符-
friend rational operator * (rational num1rational num2); //重载运算符*
friend rational operator / (rational num1rational num2); //重载运算符/
friend bool operator ==(rational num1rational num2); //重载运算符==
friend double real(rational x); //声明转换函数
private:
void optimization(); //优化有理数函数
int denominator; //分母
int numerator; //分子
};
/*****************************************************************************/
// matrix.h: interface for the matrix class.
class matrix
{
public:
void Disp(); //显示矩阵所有元素
int matrix::operator ()(short row short col); //重载运算符成员函数()
void SetElem(short rowshort colint val); //将元素(rowcol)设置为val
matrix();
matrix(short rshort c)
{
rows= r;
cols= c;
elems= new int[rows*cols];
}
virtual ~matrix();
friend matrix operator +(matrix pmatrix q); //重载运算符+
friend matrix operator -(matrix pmatrix q); //重载运算符-
friend matrix operator *(matrix pmatrix q); //重载运算符×
private:
int * elems; //存放矩阵的所有元素
short cols; //矩阵的列
short rows; //矩阵的行
};
/*****************************************************************************/
// set.h: interface for the set class.
//enum bool {falsetrue};
enum errcode {noerroverflow};
//定义集合类
class set
{
public:
void print(); //显示输出集合元素
set(){card=0;}
virtual ~set();
errcode additem(int); //增加集合元素
friend bool operator &(intset); //声明重载运算符&,判断某一整数是否属于某一集合
friend bool operator ==(setset); //声明重载运算符==判断两个集合是否相等
friend bool operator !=(setset); //声明重载运算符!=,判断两个集合是否不等
friend set operator *(setset); //声明重载运算符*,求两个集合的交
friend set operator +(setset); //声明重载运算符+求两个集合的并
friend bool operator <(setset); //声明重载运算符<判断某一集合是否为另一集合的纯子集
friend bool operator <=(setset); //声明重载运算符<=判断某一集合是否为另一集合的子集
private:
int elems[16];
int card;
};
/*****************************************************************************/
// complex.cpp: implementation of the co
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-12-03 22:06 C++课程设计报告-科学计算器加强版\
文件 413184 2019-12-03 22:04 C++课程设计报告-科学计算器加强版\C++课程设计报告-科学计算器加强版.doc
文件 24714 2019-12-03 22:05 C++课程设计报告-科学计算器加强版\科学计算器加强版.cpp
- 上一篇:AGC 自动增益控制demo
- 下一篇:GeoTiff读取程序
相关资源
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- C语言课程设计
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- c语言电子商务系统
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
评论
共有 条评论