c++ 高中公式与计算--课外练习.docVIP

  • 3
  • 0
  • 约9.68千字
  • 约 29页
  • 2016-08-22 发布于河南
  • 举报
c高中公式与计算--课外练习

主题:高中几何公式与计算 制作: 指导老师: 附件:运行程序 附件1:主函数 附件2: 调用函数 附件3: 几何公式面积计算类 附件4:几何公式面积计算类的继承 主函数代码请链接: 主函数 调用函数代码请链接: 调用函数 面积计算类代码请链接: 面积计算类 体积计算类代码请链接: 体积计算类 主函数代码: #include iostream using namespace std; #include iomanip #include 调用函数.h void main() { cout ********12--402:几何公式与计算********\n; int n; translation trans; while (1) { cout endl; cout 1.查询公式 0.继续 endl; cin n; if (n) trans.showExpressions(); cout endl; cout 1.三角形面积计算 2.矩形面积或体积计算\n 3.正方面积或正方体体积计算 4.平行四边形面积计算\n 5.梯形面积计算 6.菱形面积计算\n 7.圆面积或球体积计算 8.扇形面积计算\n 9.正多边形面积计算 0.退出\n endl;; cin n; if (n==0) { cout endl; cout ********谢谢使用******** endl; break; } switch(n) { case 1: trans.cTrianqle(); break; case 2: trans.cRectangle(); break; case 3: trans.cSquare(); break; case 4: trans.cParallelogram(); break; case 5: trans.cTrapezia(); break; case 6: trans.cRhombus(); break; case 7: trans.cCircularity(); break; case 8: trans.cSector(); break; case 9: trans.cPolygon(); break; } } system(pause); } 返回首页 调用函数代码: #include iostream using namespace std; #include 公式头文件1.h class translation { public: void showExpressions() { cout 以下出现的符号所代表的意义为:\n S:面积 V:体积 \n u:上底边 d:底边长 \n a:长 b:宽 h:高\n r:半径 ∏:Pi(即3.1415926) l:弧长\n m:长对角线 n:短对角线\n N:边数\n endl; cout 矩形的面积与体积公式:\nS=a*b V=a*b*h\n endl; cout 正方形与正方体的面积与体积公式:\nS=a^2 V=a^3\n endl; cout 圆与球的面积与体积公式:\nS=∏*r V=(4/3)*∏*(r^3)\n endl; cout 三角形的面积公式为:\nS=(1/2)*d*h\n endl; cout 平行四边形的面积公式:\nS=d*h\n endl; cout 梯形的面积公式:\nS=(1/2)*(u+d)*h\n endl; cout 菱形的面积公式:\nS=(1/2)*m*n (两对角线乘积的1/2)\n endl; cout 扇形的面积公式为:\nS=(1/2)*l*r\n endl; cout 正多边形的面积公式: endl; cout 1 d endl; cout S=-*d*---------------*2*N endl; cout 2 tan(360/(2*N)) endl; system(pause); } void cTrianqle() //三角形 { int n; float lonth,high;

文档评论(0)

1亿VIP精品文档

相关文档