I work 04 languages blog

problem answer
This work belongs courses C Programming Language II
Where this requirement in the job https://edu.cnblogs.com/campus/zswxy/CST2019-3/homework/8718
My aim in this course is Learn C language, to lay the foundation program, into the core concept, have their own understanding and ideas
In particular aspects of the job which helped me achieve goals Consolidate the C programming language, practice a wider variety of code statements, reasonable and accurate writing code
references "PTA Frequently Asked Questions" (PTA complete the job) teacher Lin Jimei University blog (blog complete reference work)

1. PYA lab assignments.

1.1 calculating partial sequence and the inverse of the square.

1.1.1 Data Processing.

  • Data are expressed: integer variable: i, m, n. Double-precision floating-point variables: sum. i, m, n, into the variable statements for processing operations, sum of the output variable.
  • Data processing: the expression: SUM = SUM + POW (I, 2) + 1.0 / I . Use the for statement loop structure.

    1.1.2 Screenshot experiment code.

    1.1.3 build test data.

    Input data Output Data Explanation
    1 2 sum=6.500000 m=1,n=2
    2 4 sum=30.083333 m=2,n=4
    3 6 sum=86.950000 m=3,n=6
    4 8 sum=190.884524 m=4,n=8

    1.1.4 PTA to submit a list.

    Submit a list of instructions.

  • Compile error: 1.0 / i statement later in 1 .0 did not play up. Beginning semicolon after the for statement did not play spaces.

    1.2 N presequence demand items and interleaving.

    1.2.1 Data Processing.

  • Data are expressed: integer variable: i, N. Double-precision floating-point variables: sum. i, N is the processing operation statement entered for the input variable, sum of the output variable.
  • Data processing: the expression: SUM = SUM + POW ((-. 1), I +. 1) I / (2 I-. 1) . Use the for statement loop structure.

    1.2.2 Code shots.

    1.2.3 build test data.

    Input data Output Data Explanation
    2 sum=0.333 N=2
    3 sum=0.933 N=3
    4 sum=0.362 N=4
    6 sum=0.372 N=6

    1.2.4 PTA to submit a list.

    Submit a list of instructions.

  • Mistakes: scanf statement did not play & & N, drunk.
  • Compile Error: printf statement sum =% .3f multi-hit SUM = (I still do not know the reasons, SUM = break into a note influence)

    2. Code peer assessment.

    Students code in Figure.


    My code chart.

  • 1. There are differences in my code for loop content, I was on an assignment statement using the function sum is described.
  • 2. My code relative to other students in the code is more concise and clearer in my code variables relatively small statement, but the sum of the assignment may be more difficult to understand.

    3. The study concluded.

    3.1 learning progress bar.

    Week / Date This week the time spent Lines of code Learned knowledge Introduction Currently more confusing issues
    Four /9.16~9.22 2 hours Line 40 Basic code and the output starts, line breaks no
    Five /9.23~9.29 2 hours Line 28 Celsius Fahrenheit code the corresponding Not appropriate to use printf
    Seven /10.7~10.13 5 hours Line 88 Write piecewise function output triangle area and perimeter, seeking bank interest Use of local and scanf if-else statement is not clear
    Eight /10.14~10.20 7 hours 122 line Learn the for statement, the compiler applet can solve mathematical problems pta fifth title in the job, printf statement sum = after use will show Wrong Answer

    3.2 cumulative number of lines of code and blog words.

    3.3 summarizes the learning content and insights.

    3.3.1 learning content summary.

  • 新学习了for语句循环条件的使用,for语句分为三个部分:初值表达式、条件表达式、步长表达式。注意被反复执行的语句只能是一条语句。

    3.3.2 学习体会。

  • 通过本周的学习,虽说在打代码和打字速度都有所提升,但还不符合我的要求,还要继续努力。学会了怎样使用代码编程来处理一些简单数学问题,其中虽有很多磕磕绊绊,我庆幸自己能坚持下来,一步步解决它,这个过程是无与伦比的,我很享受。我会一如既往的学习下去,继续加油。

Guess you like

Origin www.cnblogs.com/lengsiwei/p/11695812.html