3.22和3.23

3.22
#include<iostream>
using namespace std;
const double PI=3.14;
class Circle{
public:
	Circle(int r)
	{radius=r;}
	double area()
	{
		return(PI*radius*radius);
	}
private:
	int radius;
};
	int main()
	{
		Circle r1(10);
		r1.area();
		cout<<"the Circle's area is"<<r1.area()<<endl;
		return 0;
	}
3.23
#include<iostream>
using namespace std;
const double PI=3.14;
class cylinder{
public:
cylinder(double r,double h)
{
	radius=r;
	high=h;
}
double v()
{return(PI*radius*radius*high);}
void vol()
{cout<<"the cylinder's v is"<<'\t'<<v()<<endl;}
private:
	double radius;
	double high;
};
int main()
{
	cylinder v1(4.2,5.5);
	v1.v();
	v1.vol();
	cylinder v2(3,6);
	v2.v();
	v2.vol();
	return 0;
}

用MATLAB计算波动率,股票历史价格为3.64 3.61 3.58 3.6 3.59 3.57 3.58 3.6 3.57 3.52 3.49 3.48 3.45 3.43 3.46 3.47 3.49 3.54 3.53 3.5 3.52 3.55 3.42 3.42 3.43 3.44 3.39 3.38 3.41 3.42 3.37 3.44 3.4 3.42 3.41 3.42 3.42 3.39 3.26 3.16 3.18 3.21 3.16 3.24 3.25 3.26 3.26 3.23 3.27 3.32 3.3 3.26 3.25 3.26 3.18 3.22 3.18 3.11 3.14 3.18 3.2 3.13 3.16 3.15 3.14 3.21 3.2 3.21 3.25 3.28 3.25 3.24 3.29 3.28 3.23 3.19 3.17 3.2 3.16 3.16 3.19 3.25 3.25 3.25 3.23 3.3 3.31 3.3 3.33 3.31 3.33 3.27 3.29 3.29 3.31 3.35 3.35 3.33 3.29 3.29 3.3 3.29 3.25 3.22 3.24 3.24 3.23 3.22 3.21 3.28 3.26 3.26 3.26 3.24 3.21 3.25 3.25 3.26 3.27 3.25 3.22 3.18 3.16 3.18 3.19 3.21 3.22 3.25 3.3 3.35 3.35 3.35 3.34 3.3 3.32 3.27 3.24 3.26 3.24 3.28 3.27 3.27 3.29 3.22 3.25 3.26 3.25 3.24 3.19 3.21 3.22 3.2 3.22 3.17 3.12 3.13 3.17 3.17 3.21 3.21 3.19 3.13 3.14 3.11 3.04 3.1 3.1 3.12 3.13 3.12 3.09 3.1 3.12 3.12 3.14 3.13 3.08 3.1 3.04 3.06 3.06 3.11 3.09 3.08 3.05 2.95 2.91 2.89 2.91 2.92 2.83 2.69 2.81 2.86 2.89 2.87 2.88 2.9 2.88 2.84 2.84 2.82 2.9 2.88 2.92 2.91 2.88 2.91 2.83 2.88 2.87 2.91 2.91 2.87 2.84 2.82 2.78 2.8 2.66 2.66 2.71 2.75 2.79 2.78 2.7 2.68 2.7 2.72 2.7 2.73 2.7 2.74 2.73 2.73 2.79 2.76 2.72 2.72 2.72 2.74 2.76 2.79 2.78 2.78 2.81 2.83 2.86 2.85 2.89 2.84 2.87 2.91 2.89 2.93 2.92 2.93 2.9 2.94 2.98 3.02 3.04 3.02 3.07 3.06 3.06 3.06 3.01 3 3.01 2.96 2.94 2.93 2.91 2.87 2.91 2.9 2.91 2.87 2.89 2.88 2.89 2.87 2.87 2.83 2.82 2.77 2.75 2.78 2.82 2.8 2.8 2.77 2.83 2.84 2.82 2.81 2.82 2.8 2.79 2.79 2.77 2.75 2.79 2.79 2.77 2.77 2.8 2.78 2.75 2.74 2.76 2.75 2.75 2.8 2.81 2.79 2.78 2.72 2.72 2.71 2.69 2.67 2.67 2.65 2.68 2.65 2.65 2.65 2.59 2.58 2.59 2.56 2.63 2.62 2.61 2.56 2.54 2.53 2.44 2.43 2.44 2.42 2.37 2.33 2.44 2.46 2.42 2.51 2.52 2.5 2.48 2.48 2.56 2.58 2.63 2.62 2.6 2.59 2.56 2.57 2.58 2.56 2.59 2.54 2.65 2.64 2.63 2.62 2.68 2.69 2.67 2.68 2.71 2.68 2.68 2.7 2.68 2.69 2.65 2.61 2.61 2.63 2.62 2.61 2.64 2.65 2.63 2.65 2.65 2.66 2.71 2.72 2.75 2.74 2.75 2.75 2.8 2.85 2.84 2.82 2.83 2.85 2.85 2.82 2.83 2.82 2.78 2.74 2.75 2.74 2.77 2.76 2.78 2.79 2.76 2.75 2.72 2.8 2.81 2.78 2.77 2.74 2.73 2.75 2.78 2.78 2.78 2.75 2.72 2.7 2.68 2.64 2.67 2.65 2.65 2.63 2.64 2.62 2.65 2.66 2.67 2.66 2.64 2.64 2.64 2.67 2.67 2.67 2.68 2.67 2.69 2.69 2.68 2.67 2.67 2.68 2.74 2.75 2.72 2.71 2.66 2.62 2.62 2.62 2.66 2.68 2.69 2.69 2.72 2.71 2.67 2.67 2.63 2.68 2.67 2.65 2.64 2.63 2.66 2.62 2.58 2.57 2.56 2.55 2.54 2.5 2.51
06-10
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值