Experiment two sequential Structured Programming (validation experiments
An-Hui Engineering University
Python programming test report
Class Logistics 192 Name Wang Chengyu school number 3190505202 scores
Date 2020.3.22 instructor repair buildings
Experiment two sequential Structured Programming (confirmatory test)
【Purpose】
(1) Method of control of input and output data;
(2) structure of the program execution in order familiar statements;
(3) Design of the sequence control structure of the program.
[Experiment Conditions]
PC or remote programming environment
[Experimental] content
1, completed three programming problems. (Python123)
(1) Calculation of the area of a circle calculated S
Problem Description:
The calculated area of a circle radius of the circle, radius 25. Please write and run the following code:
radius = 25 # 25 is the radius of a circle
area = 3.1415 * radius * radius # circular area is calculated according to the formula
print ( "{:. 2f}". format (area)) # outputs only two decimal places the result
input Output:
Input: None Output: 1963.44
(2) sum
Questions Question:
Programming, input from the keyboard two numbers x, y, find x, y and assigned to the sum of s, the final output s.
input Output:
(3) Determine the volume of a sphere
Problem Description:
Enter the radius of the sphere, the sphere volume calculation.
input Output:
Input: A positive number
Output: the volume of the ball, as a result two decimal places
[Experimental recording and analysis]
(Please fill in the experimental records and analysis results)
1. Calculate the circular area
Experiments recorded as follows
2. The sum
Experiments recorded as follows:
3. Calculate the volume of a sphere
Experiments recorded as follows
[Questions]
1, question 1 What influence factors and calculation accuracy of 3 questions? How to make a value of 1 and 3 to get a more accurate? (You can try on the local computer, or self-programmed on python123)
(1) Factors influencing input value has a question about the circumference ratio, a value of 3.1415, the next can take on more decimal places to obtain a more accurate value.
Factors title 3 (2) is affected {: .2f}, i.e., the output of decimal digits, if {: .3f} {:. 4f}, then, that the values obtained can be more accurate.
An-Hui Engineering University
Python programming test report
Class Logistics 192 Name Wang Chengyu school number 3190505202 scores
Date 2020.3.22 instructor repair buildings
Experiment two sequential Structured Programming (confirmatory test)
【Purpose】
(1) Method of control of input and output data;
(2) structure of the program execution in order familiar statements;
(3) Design of the sequence control structure of the program.
[Experiment Conditions]
PC or remote programming environment
[Experimental] content
1, completed three programming problems. (Python123)
(1) Calculation of the area of a circle calculated S
Problem Description:
The calculated area of a circle radius of the circle, radius 25. Please write and run the following code:
radius = 25 # 25 is the radius of a circle
area = 3.1415 * radius * radius # circular area is calculated according to the formula
print ( "{:. 2f}". format (area)) # outputs only two decimal places the result
input Output:
Input: None Output: 1963.44
(2) sum
Questions Question:
Programming, input from the keyboard two numbers x, y, find x, y and assigned to the sum of s, the final output s.
input Output:
(3) Determine the volume of a sphere
Problem Description:
Enter the radius of the sphere, the sphere volume calculation.
input Output:
Input: A positive number
Output: the volume of the ball, as a result two decimal places
[Experimental recording and analysis]
(Please fill in the experimental records and analysis results)
1. Calculate the circular area
Experiments recorded as follows
2. The sum
Experiments recorded as follows:
3. Calculate the volume of a sphere
Experiments recorded as follows
[Questions]
1, question 1 What influence factors and calculation accuracy of 3 questions? How to make a value of 1 and 3 to get a more accurate? (You can try on the local computer, or self-programmed on python123)
(1) Factors influencing input value has a question about the circumference ratio, a value of 3.1415, the next can take on more decimal places to obtain a more accurate value.
Factors title 3 (2) is affected {: .2f}, i.e., the output of decimal digits, if {: .3f} {:. 4f}, then, that the values obtained can be more accurate.