2012C++程序设计实验报告【3.3】
来源:互联网 发布:如何挖掘数据的价值 编辑:程序博客网 时间:2024/04/30 14:21
/* (程序头部注释开始)
* 程序的版权和版本声明部分
* Copyright (c) 2011, 烟台大学计算机学院学生
* All rights reserved.
* 文件名称: 立方体的表面积和体积(第三周任务四)
* 作 者: 王琳
* 完成日期: 2012年 3 月17日
* 版 本 号:3-3-1
* 对任务及求解方法的描述部分
* 输入描述:立方体的体积和表面积
* 问题描述: ......
* 程序输出: ......
* 程序头部的注释结束
*/
源程序
01.#include <iostream> 02.using namespace std; 03.class Bulk 04.{ 05.public: 06. void get_value(); 07. void display(); 08.private: 09. float lengh; 10. float width; 11. float height; 12.}; 13. 14.void Bulk::get_value() 15.{ 16. cout<<"please input lengh, width,height:"; 17. cin>>lengh; 18. cin>>width; 19. cin>>height; 20.} 21. 22.void Bulk::display() 23.{ 24. cout<<"The volume is: "<<lengh*width*height<<endl; 25. cout<<"The surface area is: "<<2*(lengh*width+lengh*height+width*height)<<endl; 26.} 27. 28.int main() 29.{ 30. Bulk b1,b2,b3; 31. 32. b1.get_value(); 33. cout<<"For bulk1: "<<endl; 34. b1.display(); 35. 36. b2.get_value(); 37. cout<<"For bulk2: "<<endl; 38. b2.display(); 39. 40. b3.get_value(); 41. cout<<"For bulk3: "<<endl; 42. b3.display(); 43. return 0; 44.}
- 第一次C程序设计实验报告
- 第二次C程序设计实验报告
- 第三次C程序设计实验报告
- 2012C++程序设计实验报告【3.3】
- C 程序设计实验报告(二)
- 第四次C程序设计实验报告
- 第五次C程序设计实验报告
- C程序设计课程-第七次实验报告
- c程序设计第七次上机实验报告
- 第七次C程序设计实验报告
- 第八次C程序设计实验报告
- 第九次C程序设计实验报告
- 第十次C程序设计实验报告
- 第十一次C程序设计实验报告
- 2012 C++程序设计实验报告(一)
- 2012C++程序设计实验报告【2.1】
- 2012C++程序设计实验报告【2.2】
- 2012C++程序设计实验报告【2.3】
- Oracle分页技术详解
- sdibt K尾相等数
- const成员函数
- 什么是应用程序实例
- 算法简介
- 2012C++程序设计实验报告【3.3】
- java同步机制:synchronized
- 不联网,ubuntu下安装gcc
- SQL函数 LTRIM和RTRIM的用法
- mac技巧汇总
- Java小方法:文件夹内文件批量重命名
- Android API中文文档Button
- centos 启用 mysql
- 转几篇malloc和calloc的文章