Analysis of 2015 Class C ++ 2nd weekly practice projects

Source: Internet
Author: User

Analysis of 2015 Class C ++ 2nd weekly practice projects

Project 1-declaring "Sovereignty "]
You are already a CSDN blogger. Compile a program in an IT-specific way, output what you want to say on the screen, and publish a blog post as required.

[Project 2-fat people do not want to talk about weight]
The standard weight formula for adult men is:
Standard weight (kg) = height (cm )? 100

 
20% is overweight, 20% is lighter than the standard weight. Write a C ++ program, enter the height and weight, and complete the following tasks:
(1) Calculate and output the standard weight.
(2) Calculate the standard weight. If you are overweight, give a prompt.
(3) Calculate the standard weight. If the weight is overweight, a prompt is displayed. If the weight is not overweight, a prompt is displayed.
(4) Calculate the standard weight and output the weight status (normal/overweight/ultra-light)
After debugging the program, post a blog post as the computer report.

 

[Project 3-small test cycle]
Write out the program for solving the following task. [Note: m is a variable, input in the program]
(1) Calculate the sum of squares from 1 to m.
(2) Calculate the sum of all the odd numbers between 1 and m.
(3) Calculate the reciprocal sum of 1 to m, that is 1 + 12 + 13 + 14 +... + 1 m

 
(4) Evaluate: 1? 12 + 13? 14 +... + (? 1) (m + 1) × 1 m  
(5) m !, That is 1 × 2 × 3 ×... × m  

 

Project 4-solving with loops]
Write the program that implements the following task solving:
(1) Use the following formula to calculate π Approximate value of (calculated until the absolute value of the last item is smaller 10? 5 )
π 4 = 1? 13 + 15? 17 +...

 
Reference

 

(2) the Fibonacci series are widely used in computational science, economics, and other fields. The first and second numbers are 1, starting from 3rd, each number is the sum of the first two. Accordingly, this series is: 1 1 2 3 5 8 13 21 34 55 89 ......, Design the program and output the series until the number exceeds 10000.
[Prompt] The sequence can be expressed:
{F1 = f2 = 1fn = fn? 1 + fn? 2, n> 2

 
Reference

 

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.