The importance of thinking

Source: Internet
Author: User

2.8 Programming Thinking

What the program is.

The program in life:

1) Dormitory maintenance: fill in the repair → report to the dormitory manager → contact Property → find maintenance workers → home repair → feedback.

2) bank account opening: Customer fill out the application form → valid documents → the authenticity of the audit data (1, I, the real complete information, 2, other people, there is a power of attorney, the information is complete through; Do not meet these conditions refused) → input system → set password → release card, passbook;

The procedure in life: a description of the steps (process) to solve the problem in life;

A program in a computer: a description of the steps to solve the problem, but a description of the language

Program

Performer

Description Language

Execution speed

The program in life

People

Natural language

Relatively slow

Computer programs

Computer

Computer language

(e.g. JS)

Very fast

The fastest robot: a breakthrough in the number-level of the "Divinity, Taihu Lake Light" computing system. This is the world's first super computer running more than 1 billion times/second, peak performance of up to 1.254 billion times/second, sustained performance of 930 million times/second, close to "Tianhe second" 3 times times. Professor Yang Guangwen, for example, "The Power of Divinity, Taihu Lake," a minute of computing capacity equivalent to 7.2 billion people around the world at the same time with a calculator uninterrupted calculation 32 years.

What is programming.

Develop or prepare problem-solving processes based on business needs

The person who compiles Cheng should be very familiar with business or very quiet proficient in business;

If the requirements of the program for computer programming are:

1) must be very proficient

2) Proficient in computer language

Understand the direction of our study

1) Problem-solving ideas:

2) Computer language

3) Change of thinking mode

Focus is to solve the problem of ideas, and the idea is not related to computer language, although we are learning JS, but the more important is not JS content;

The difficulty is the change of thinking mode, that is to say now, need to stand in the computer angle to think and describe the problem;


Through this case, we learned the following knowledge:

1) programming is divided into two steps: thinking, coding;

2) ideas can be described in the form of natural language, flow chart and so on, which can describe the solution clearly;

3) translate the idea into corresponding code;


3 structure of choice in statement 3.1Javascript

Use if (condition satisfies to True) {Execute}else{not execute, execute another};

routines for 3.2IF statements

1) A selection basis (conditions)

2) Two options

1. Work: Design and implement a program that prints a four-digit inverse number. For example, 1234 becomes 4321

2, design and realize the user input a number and determine whether this number is Narcissus number (Narcissus number: a three-digit number if the number of 10 bits of the cube and its own equal, then this number is narcissus number) known Narcissus number 153, 370 can be used to test

3, BMI index (i.e. body mass index, called BMI, also known as body weight,
English body Mass Index, referred to as BMI), is used for weight kg
The number divided by the square of the height of the number of meters, is currently used internationally
A measure of body fat and thinness and health. Mainly used for statistical purposes,
When we need to compare and analyze a person's weight for people of different heights brought by
Health effects, the BMI is a neutral and reliable indicator.
* Body mass index (BMI) = weight (kg) ÷ height ^2 (m)
such as: 70kg÷ (1.75x1.75) =22.86
Adult's BMI value:
Too light: less than 18.5
Normal: 18.5-24.99
Overweight: 25-28
Obesity: 28-32
Very obese, above 32

4,   Calculate the amount of blood transfusion. Calculation method: The amount of blood transfusion based on gender and weight. The female body weight does not exceed 50kg blood transfusion quantity is 200 ml, otherwise 250 ml; The male does not exceed 60kg the blood transfusion quantity is 250 ml, otherwise 300 ml. Programming and implementing the computational method.

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.