前言:在星期三的第一次面向对象程序设计课,遇见我们的栋哥,初次见面,发现老师的幽默.....下课后,就给我们一道作业题目。。。

作业要求:Create a program that asks for the radius of a circle and prints the area of that circle, using cin and cout. The whole program

should be divided into two source files (.cpp).Hand in the source files and the head files which you create.

翻译过来就是:创建一个程序,给出球的半径并打印该圆的面积使用 cin 与 cout。整个程序应分为两个源代码文件 (.cpp)。手中的源文件和头文件你的创造。

(ps:这是百度的翻译)

然后我去做了一个.h文件(用来存放函数)和一个.cpp(来输入半径R的)


>.cpp #include<iostream>
#include"print.h" using namespace std;
int main()
{
double r;
r=input();
Pr(r);
return 0;
} >.h #include<iostream>
#define pi 3.1415926 using namespace std; double input()
{
double R;
cout << "Please input the value of the radius of the circle: ";
cin >> R ;
return R;
} void Pr(double r)
{
cout << pi*r*r << endl;
}

此处是传到github代码;

最后还是那句话,好好学,认真学,努力学。加油!!!

object-oriented first work的更多相关文章

  1. CSharpGL - Object Oriented OpenGL in C#

    Object Oriented OpenGL in C#

  2. Object Oriented Programming python

    Object Oriented Programming python new concepts of the object oriented programming : class encapsula ...

  3. What is Object Oriented Design? (OOD)

    Object Oriented Design is the concept that forces programmers to plan out their code in order to hav ...

  4. Java - 面向对象(object oriented)计划 详细解释

    面向对象(object oriented)计划 详细解释 本文地址: http://blog.csdn.net/caroline_wendy/article/details/24058107 程序包括 ...

  5. OO开发思想:面向对象的开发方法(Object oriented,OO)

    面向对象的开发方法(Object oriented,OO)认为是好文章吧,拿来分享一下(转载) 面向对象的开发方法(Object oriented,OO) 从事软件开发的工程 师们常常有这样 的体会: ...

  6. JavaScript: Constructor and Object Oriented Programming

    Constructor :  Grammar: object.constructor Example: Javascript code: 1 function obj1() { this.number ...

  7. 面对对象编程(OOP, Object Oriented Programming)及其三个基本特性

    一千个读者,一千个哈姆雷特.对于面对对象编程,书上都会告诉我们它有三个基本特性,封装,继承,多态,但谈起对这三点的见解,又是仁者见仁智者见智,感觉还是得多去编程中体验把 . 面向对象编程(OOP, O ...

  8. Python学习札记(三十) 面向对象编程 Object Oriented Program 1

    参考:OOP NOTE 1.面向对象编程--Object Oriented Programming,简称OOP,是一种程序设计思想.OOP把对象作为程序的基本单元,一个对象包含了数据和操作数据的函数. ...

  9. 使用一个数组存储一个英文句子"java is an object oriented programing language"

    class fun { public static void main(String[] args) { String str="java is an object oriented pro ...

  10. 《Using Databases with Python》Week1 Object Oriented Python 课堂笔记

    Coursera课程<Using Databases with Python> 密歇根大学 Charles Severance Week1 Object Oriented Python U ...

随机推荐

  1. vb6 使用msxml2.serverxmlhttp 请求HTTP

    Private Sub Command1_Click() Command1.Enabled = False GetHtmlStr Text1 End Sub Private Sub GetHtmlSt ...

  2. zhengruioi 470 区间

    区间 链接 题意:给定n个区间[li,ri].你可以选出任意一些区间,设选出的区间个数是s,[l,r]是这些区间的交,求min(s,r-l+1)的最大值. N≤3×105 分析:首先按照左端点排序,然 ...

  3. Spring MVC的Rest URL 被错误解析成jsp, 导致404错误(XML方式下@Controller和@RestController需要配置<mvc:annotation-driving/>)

    问题: 最近在原有MVC的WEB应用中添加一个REST服务,结果始终报404错误.把 Spring debug 日志打开,发现处理REST请求的Controller已经正确进入 [org.spring ...

  4. 洛咕 P2155 [SDOI2008]沙拉公主的困惑

    洛咕 P2155 [SDOI2008]沙拉公主的困惑 有个结论,就是如果\(gcd(a,b)=1\),那么\(gcd(a+kb,b)=1\).证明比较显然. 所以这个题目要问的\(n!\)就可以分成\ ...

  5. 解决shell命令"** is not in the sudoers file..."错误

    Linux中新建的普通用户一般不会分配给root权限,每次都su root也太麻烦,可以通过在/etc/sudoers文件中添加当前用户的方式,给当前用户赋予sudo命令的使用权限. # 切换到roo ...

  6. TCP Over HTTP 的Buffer问题

    记录下备忘. 场景:要把TCP拆成一个个HTTP请求,通过Proxy 1.HTTP Client上载数据到CCProxy ,然后再到Web服务器的时候. 如果数据量比较小,例如10个字节,Proxy就 ...

  7. python连接数据库问题小结

    在使用python连接数据库的时候遇到了这个问题: 大概意思就是在django的setting.py中配置的用户名和密码报错. 主要就是修改setting.py的配置 其中在里边的name和user项 ...

  8. SecureCRT 用法总结

    SecureCRT 用法总结   1.下载与破解方法: Mac:https://www.jianshu.com/p/9427f12b1fdb Window:https://drive.google.c ...

  9. Unity3D之AR开发(一)

    近期研究了下AR技术,下面给大家分享一下. 第一种方法:高通AR(Vuforia) Vuforia插件下载地址(官网): https://developer.vuforia.com/downloads ...

  10. 报错android.view.InflateException: Binary XML file line #11: Attempt to invoke virtual method 'boolean

    出现这种问题,打开Android monitor的调试信息发现是 android.view.InflateException: Binary XML file line #11: Attempt to ...