C language Ⅰ | blog work 07

This work belongs courses C Programming Language Ⅰ
Where the job requires https://www.cnblogs.com/tongyingjun/p/11809219.html
My aim in this course is Master switch statement usage, know the general's three ways to use the break statement
In particular aspects of the job which helped me achieve goals PTA jobs, and in their own compiler written above code and coding errors, Baidu above literature
references C Programming Language, literature Baidu

1.PTA lab assignments

1.1 programming questions require students to read the N percentile scores, the statistical distribution of a five-point performance. Conversion rule to a five-point score percentile score: not less than 90 is divided into A; less than 90 and greater than or equal to 80 B; 80 less than and greater than or equal to 70 are C; less than 70 and greater than or equal to 60 D; 60 is less than E.
⑴ data processing
data expression: int this question using plastic structure, for switch statements and loop structure.
data processing:

⑵ experiment code screenshots

⑶ create test data

Input data Output Data Explanation
77 54 92 73 60 65 69 1 0 2 3 1 A: 1 person B: 0 people C: 2 persons D: 3 persons E: 1 person
91 81 71 88 55 69 52 1 2 1 1 2 A: 1 person B: 2 persons C: 1 person D: 1 person E: 2 persons
77 65 51 98 89 62 81 1 2 1 2 1 A: 1 person B: 2 persons C: 1 person D: 2 persons E: 1 person

⑷PTA submit a list and description

Error reason:
① Wrong Answer: In his only start a for loop, but can be compiled directly copied PTA above
② wrong answer: add a for loop after asked about the students, but the answer is wrong, because I do not variables a, B, C, D, E is defined as 0.5
1.2 N given positive integer, the following three requirements you derive results: A1 = largest integer that is divisible by 3 A2 = integers K so that it can be expressed as an integer number of 3K + 1 A3 = integers of K so that it can be expressed as the average of all (one decimal place) 3K + 2 integer
⑴ data processing
data representation: the title uses int shaping structure, cyclic structure, and for a switch statement, the used double double precision floating point. Both defines the different variables.
data processing:

⑵ experiment code screenshots

⑶ create test data

Input data Output Data Explanation
8,5 8 7 6 9 1 3 10 9 3 6.5 9 is divisible by 3 only meet 3k + 1 only three digital calculation results for the 3k + 2
8,15 18 7 6 9 1 3 10 18 3 NONE 3 is divisible only 18 3k + 1 results in line with only three non-compliance of the digital calculation 3k + 2

⑷PTA submit a list and description

Error reason:
① Wrong Answer: Title not read, that a mathematical code wrong operation, there is no clear operation between
② wrong answer: there is no beginning or the variable is defined as 0, a for loop structure out a little mistake , wrong numbers

2. Code peer assessment

⑴ students Code shots (three shifts software Wang Wenzhi)

Code your own screenshots ()

⑵ comparison
our code similar format is almost the definition of a variable is different, the format switch statement is not the same, he's playing more space than I do. Other no different

Students Code Screenshot (three shifts have good software)

Own Code Screenshot

Comparison
of different points: the variable is not defined by him to be the subject, as well as the back of the switch statement constant expressions and statements are not the same.
The same point: the two of us is almost the same code, but the code format is not the same, my lines of code than his less

summarize

⑴ learning progress bar

Week / Date This week the time spent Lines of code Learned knowledge Introduction Currently more confusing issues
Week Seven Five and a half hours 140 Familiar with multi-branch structure of the switch statement Still not very good switch statement Usage

⑵ cumulative lines of code words and blog

⑶ learning content summary and insights
① learned this week feeling something less, but more difficult to understand.
②PTA operation code does not know why the teacher must be required to write a switch statement, the third and fourth questions with if-else statement is relatively easy, but do not know how to use a switch statement get.
③ As more and more knowledge of the C language learning, feeling himself can not keep up the pace of the teacher that he purposely added that online learning c ++ base, see for yourself another teacher in the class.
④ but still have a lot of knowledge does not make sense, ambiguous, in the Baidu search above can understand that, but can not understand all, rely on my own class listen.
④C language is really more and more difficult, do not know to catch up, others are learning and practicing, they themselves do not know where to start

Learning content summary

Guess you like

Origin www.cnblogs.com/tongyingjun/p/11809219.html