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

作业要求: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. 新装Linux无法访问域名

    昨天新安装Linux,发现ping百度ping不通: 经查询,得知是系统没有配置DNS域名服务器,百度搜索DNS域名服务器列表: 编辑 /etc/resolv.conf 文件,添加查询到的DNS服务器 ...

  2. 使用jieba导入引用方法时,报错AttributeError: module 'jieba' has no attribute 'cut'

    一.问题描述 import jieba导入后,使用jieba.cut()方法时报错AttributeError: module 'jieba' has no attribute 'cut' 二.问题分 ...

  3. Java——String类总结---18.09.27

    1.String类 String类在java.lang包中,java使用String类创建一个字符串变量,字符串变量属于对象.java把String类声明的final类,不能有类.String类对象创 ...

  4. JavaWeb基础—上传与下载

    1.上传(不能使用BaseServlet): 上传的作用,略 上传的要求(对表单和Servlet都有要求): 1.必须使用表单,而不能是超链接,method="post" 文件明显 ...

  5. 2017-2018-1 20155306 《信息安全系统设计基础》嵌入式C语言———提取设置时分秒

    2017-2018-1 20155306 <信息安全系统设计基础>嵌入式C语言---提取设置时分秒 要求:根据下图,完成对时分秒的设置和提取. 示例及思路分析: 思路分析:以分钟为例,根据 ...

  6. logistic softmax

    sigmoid函数(也叫逻辑斯谛函数):  引用wiki百科的定义: A logistic function or logistic curve is a common “S” shape (sigm ...

  7. 【转载】ATL问题集

    原文:http://blog.csdn.net/fengrx/article/details/4171629 这些问题是以前在csdn当版主是一些朋友整理的,今天找到了,贴到这里来! #1 如何使用控 ...

  8. pathon之多线程详解

    一.线程理论 1.什么是线程 线程指的是一条流水线的工作过程 进程根本就不是一个执行单位,进程其实是一个资源单位--------将资源集合到一起: 一个进程内自带一个线程,线程才是CPU上的执行单位 ...

  9. Java类型转换工具类(十六进制—bytes互转、十进制—十六进制互转,String—Double互转)

    /** * 数据类型转换工具类 * @author cyf * */ public class NumConvertUtil{ /** * bytes 转16进制字符串 * @param bArray ...

  10. monkey测试入门2--测试步骤、常用参数、常规monkey命令

    <凤栖梧> 柳永 伫倚危楼风细细,望极春愁,黯然生天际.草色烟光残照里,无言谁会凭栏意? 拟把疏狂图一醉,对酒当歌,强乐还无味,衣带渐宽终不悔,为伊消得人憔悴. 简要步骤:adb devi ...