Week 8 Computer Task 4-circle Calculation

Source: Internet
Author: User
01. /* 02. * Copyright (c) 2012, School of Computer Science, Yantai University 03. * All rights reserved. 04. * Author: Zhao guanzhe 05. * Completion Date: July 6, October 18, 2012. * version No.: v1.0 07.*08. * input Description: none. * Problem description: known radius and height 10. * program output: the area and perimeter of the circle, the surface area and volume of the ball, the surface area and volume of the cylindrical and conical 11. * Problem Analysis: omitted 12. * Algorithm Design: omitted 13. */# include <math. h >#include <iostream> using namespace std; # define PI 3.1415926int main () {int r, h, s, l, sq, vq, sz, vz, sy, vy; cout <"Enter the radius and height r, h:"; cin> r> h; s = r * PI; l = 2 * r * PI; sq = 4 * PI * r; vq = 3.0/4.0 * PI * r; sz = r * PI * h; vz = r * h; sy = PI * r + PI * r * sqrt (h * h + r * r ); vy = 3.0/1.0 * PI * r * h; cout <"Circle Area =" <s <endl; cout <"circle perimeter =" <l <endl; cout <"Ball Surface Area =" <sq <endl; cout <"ball volume =" <vq <endl; cout <"cylindrical surface area =" <sz <endl; cout <"cylindrical volume =" <vz <endl; cout <"cone surface area =" <sy <endl; cout <"cone volume =" <vy <endl; return 0 ;}

Running result:

Observation experience:

There are many errors and continuous debugging of this program. So I came to Shanxi laohe (I personally think he is the same as a friend, so I use this name) for help. The teacher analyzed several mistakes for me, which were really low-level mistakes. I checked carefully and finally corrected all the mistakes.

My summary:

With the deepening of the study, the current knowledge is almost impossible to complete the tasks assigned by Mr. He. The teacher may want us to preview in advance and master some additional knowledge points. Therefore, I personally think the task is very heavy. Through this blog, I understand that it is important to learn and use it.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.