当前位置:网站首页>C language I blog assignment 05

C language I blog assignment 05

2020-11-21 15:25:22 W thousand moon

Which course does this assignment belong to <C Language programming II>
Where are the requirements for this assignment https://edu.cnblogs.com/campus/zswxy/SE2020-4/homework/11529
The goal of this assignment < Learn better , Fewer mistakes >
This assignment helps me achieve my goal in that specific aspect < Let me more familiar with the code >
reference <C Language programming , Baidu Encyclopedia >
Student number <20209221>

1.PTA Experiment assignment

1.1 Title 1

use if-else Statement programming , Based on the input of the 100 point score score( Integers ), To the corresponding five point system grade Post output .
When 90≤ score≤100 when , grade=A ;
When 80≤ score<90 when ,grade=B;
When 70≤ score<80 when , grade=C;
When 60≤ score<70 when ,grade=D;
When 0≤ score<60 when ,grade=E.
If you enter grades score<0 or score>100, The output “Input error!”.

1.1.1 Data processing

1. Data expression : Single precision floating point float score; Character char a='A',b='B',c='C',d='D',e='E',grade
2. Data processing : expression :if (score>=90&&score<=100) else if (score>=80&&score<90) else if(score>=70&&score<80) else if(score>=60&&score<70) else if(score>=0&&score<60) else if(score>100||score<0); It's all branching

1.1.2 Screenshot of experimental code

1.1.3 Make test data

input data Output data explain
65 D The score on the five point system is D
130 Input error! Wrong grades
28 E The score on the five point system is E
-10 Input error! Wrong grades

1.1.4 PTA Submit list and description


Submit list description :
1 The first time the answer was wrong , I haven't found the reason for it for a long time , So I wrote it all over again
2 The second time the answer is partly correct , Because in one line <= No. forgot one of them = Number .

1.2 subject 2

Read a from the keyboard 4 Integers of digits , How many bits in the number are 7

1.2.1 Data processing

Data expression :int a,b,c,d,sum,n plastic
Data processing : expression :a = n / 1000; b = (n / 100) % 10; c = (n / 10) % 100 % 10; d = n % 10;

1.2.2 Screenshot of experimental code

1.2.3 Make test data

input data Output data explain
4327 1 Yes 1 Is it 7
7777 4 Yes 4 Is it 7
7175 2 Yes 2 Is it 7
2300 0 Yes 0 Is it 7

1.2.4 PTA Submit list and description


Submit list description :
Partial confirmation : forget if Don't add ; Number , The answer is partly wrong .

2. Code reviews (5 branch )

Screenshot of classmate code


Screenshot of my own code


1: Yin Zhicheng's code is relatively simple , Use of the for Loop structure , What's more, it's learned after class , It's worth learning
2: It's similar to my second code , similar . It's basically the same , It's just my score "{}" The province .

3. Learning summary (15 branch )

3.1 Learning progress bar (5 branch )

Zhou / date Time spent this week Lines of code Brief introduction of the knowledge learned The confusing question at present
The third week /11.2~11.8 4 God 78 for Loop structure What about arithmetic overflow
The fourth week /11.9~11.15 4 God 64 Custom function Write custom function
Week 5 /11.16~11.21 4 God 96 if And else The branch structure of Not very good at using for more complicated problems

3.2 Accumulate lines of code and blog words (5 branch )

3.3 Learning content summary and perception (5 branch )

3.3.1 Summary of learning content

3.3.2 Learning experience

1 This assignment is the most difficult one , It took a long time to finish .
2 I look up a lot of information , That day, I checked a night of self-study before I wrote a question .
3 At the same time, I also understand my many shortcomings

版权声明
本文为[W thousand moon]所创,转载请带上原文链接,感谢

随机推荐