????????????????????????????? Structured Programming - PowerPoint PPT Presentation

About This Presentation
Title:

????????????????????????????? Structured Programming

Description:

Structured Programming * – PowerPoint PPT presentation

Number of Views:67
Avg rating:3.0/5.0
Slides: 42
Provided by: uil62
Category:

less

Transcript and Presenter's Notes

Title: ????????????????????????????? Structured Programming


1
?????????????????????????????Structured
Programming
2
???????????????????????????????????
  • ???????
  • ??????????????
  • ???????????????????????

3
??????????????? ?? 2 ??? ???
  • ??????????????????????????
  • ??????????????????????????

4
?????????????????????????? (Modular Programming)
  • ????? (Module) ??? ???????????? (Subroutine)
    ??????????????????????? ?? 2 ??? ???
    ???????????????? ??? ?????????????????

5
?????????????????????????????????????
?????/?????
???????
???????1
???????2
???????3
???????4
???????1.1
???????1.2
???????1.3
6
??????????????????????????(Top-Down Programming)
  • ??????????????????????????????????????
  • ??????????????? (Structure Chart)
    ??????????????????
  • ??????????????????????????? ??????????????????????
    ?????
  • ???????????????????????????

7
?????????????
0 Print_Report
?????0
1 Process1
1 Process1
?????1
1.2 Process1.2
1.1 Process1.1
?????2
8
???????? ?????????????????????????????????
Input
Process
Output
??????????? ???????????? ?????????????????
1.?????????? 2.?????????????????? 3.???????????? 4
.?????????????
???????
9
0?????????????????????
???????? ?????????????????????????????????
3 ?????
4 ???????????
1 ??????????
2 ???????
10
???????????????????????????????????????
  • ????????????????? (Sequence Structure)
  • ????????????????? (Selection Structure)
  • ???????????????????? (Iteration Structure)

11
? ????????????????? (Sequence Structure)
  • ?????????????
  • ???????????????? (?????????????????????)
  • ????????????????????? ??????????????????
  • ???????????????????????

12
??????????????????????????????
13
???????? ????????????????????????????????????????
????????? (Pseudo Code) Begin Price 0
Read Amt, Cost Price Amt x Cost
Write Price End
Input Process Output
? ? ?
14
???????? ????????????????????????????????????????
  • ??????????
  • ?????????????
  • ???????? ????????????????(Price) ????????????
  • ????????? ??????????? (Amt) ??? ???? (Cost)
  • ????????????????????? ??? Price Amt x Cost
  • ?????? ????????????????
  • ??????????

????????? (Pseudo Code) Begin Price 0
Read Amt, Cost Price Amt x Cost
Write Price End
15
???????? ?????????????????????????????????????????
???????????
Input Process Output
? ? ?
16
???????? ?????????????????????????????????????????
???????????
  • ??????????
  • ?????????????
  • ???????? ?????????????? (AvgTmp) ????????????
  • ????????? ??????????????(MxTmp) ?????????(MnTmp)
  • ????? ?????????????? ??? ?????????????????????????
    ?????????
  • ?????? ??????????????
  • ??????????

????????? (Pseudo Code) Begin AvgTmp 0
Read MxTmp, MnTmp AvgTmp(MxTmpMnTmp)/2
Write AvgTmp End
17
? ????????????????? (Selection Structure)
  • ??????????????????????????????????????
  • ????????????????????? ???? ???? ???? ????????

18
??????????????????????????
  1. ????????????????????????????????????
  2. ??????????????????????????????????????????????????
    ???
  3. ?????????????????????
  4. ????????????????????? ?????????????????????? 2 ???

19
1. ??????????????????????????
????????
????/FALSE
????/TRUE
?????? A
????????? IF THEN (??????A)
20
???????? ????????????????????????????
???????? - ?????????????? 50 ???????????
??????????????????? You pass-
?????????????????? 50 ????? ?????????????
21
???????? ????????????????????????????
START
Input Process Output
? ? ?
Read Score
Y
N
22
???????? ????????????????????????????
  • ??????????
  • ?????????????
  • ?????? ????????(Score)
  • ?????????????????? 50 ???????????
    ???????????????????? You pass
  • ??????????

????????? (Pseudo Code) Begin Read
Score IF Score gt 50 THEN Write You
pass End
23
2. ?????????????????????????????????
????/FALSE
????/TRUE
?????? B
?????? A
????????? IF .. THEN
..(??????B).. ELSE ..(??????A)...
24
???????? ????????????????????????????
  • ????????
  • ?????????????? 50 ??????????? ??????????????????
    Pass- ?????????????????? 50 ?????
    ?????????????????? Fail
  • ?????? Grade ??????????????

25
???????? ????????????????????????????
START
Input Process Output
? ? ?
Y
Grade Pass
N
Grade Fail
Write Grade
STOP
26
???????? ????????????????????????????
  • ??????????
  • ?????????????
  • ?????? ???????? (Score)
  • ?????????????????? 50 ??????????? ???????????
    GradePass ??????????? 50 ????? ???????????
    GradeFail
  • ?????? ???? (Grade)
  • ??????????

????????? (Pseudo Code) Begin Read Score
IF Score gt 50 THEN Grade Pass ELSE
Grade Fail END IF Write Grade End
27
3. ???????????????????????
????/FALSE
????/TRUE
????/FALSE
????/TRUE
????/FALSE
????/TRUE
????????2
????????3
?????? A
?????? B
?????? C
?????? D
28
???????? ???????????????????????
  • ????????
  • ??????????????? 80 ????? ??????? A
  • ???????? 70-79 ??????????? ??????? B
  • ???????? 60-69 ??????????? ??????? C
  • ???????? 50-59 ??????????? ??????? D
  • ??????????????? 50 ????? ??????? F

29
????????
STOP
Write Grade
30
????
31
????????
  • ??????????
  • ?????????????
  • ?????? ???????? (Score)
  • ???????????????????gt80 ??????????? ???????????
    GradeA ??????????? ?????????????????????? gt70
    ??????????? ??????????? GradeB ???????????
    ?????????????????????? gt60 ???????????
    ??????????? GradeC ???????????
    ?????????????????????? gt50 ???????????
    ??????????? GradeD ??????????? ??????????????
    GradeF
  • ?????? ???? (Grade)
  • ??????????

????????? (Pseudo Code) Begin READ Score IF
Score gt 80 THEN Grade A ELSE IF Score
gt70 THEN Grade B ELSE IF Score
gt60 THEN Grade C ELSE IF Score gt50
THEN Grade D ELSE Grade F WRITE
Grade End
32
4. ?????????????????????
????????
?????? A
?????? B
?????? C
?????? D
33
???????? ???????????????????????
  • ????????
  • ??????????????? 80 ????? ??????? A
  • ???????? 70-79 ??????????? ??????? B
  • ???????? 60-69 ??????????? ??????? C
  • ???????? 50-59 ??????????? ??????? D
  • ??????????????? 50 ????? ??????? F

34
????????
START
Read Score
CASE Score OF
ELSE
80-100
70-79
60-69
50-59
Grade A
Grade B
Grade C
Grade D
Grade F
Write Grade
STOP
35
????????
  • ??????????
  • ?????????????
  • ?????? ???????? (Score)
  • ??????????? ???????????? 80-100 ????? ???
    GradeA 70- 79 ????? ??? GradeB 60- 69
    ????? ??? GradeC 50- 59 ????? ??? GradeD
    ????????? ??? GradeFail
  • ??????????????????????
  • ?????? ???? (Grade)
  • ??????????

????????? (Pseudo Code) Begin READ Score
CASE Score OF 80 100 Grade
A 70 79 Grade B 60 69 Grade
C 50 59 Grade D ELSE Grade
F END WRITE Grade End
36
HOMEWORK1
  • ????????????????
  • ?????????? (Algorithm)
  • ????????? (Pseudo Code)
  • Flowchart
  • ??????????????????????

37
Ex1 ??????????????? 2 ??? (Num1,Num2)
?????????Choice ???????????????
?????????????????(Result) ?????????????? Choice
A ??????????????????????????? Choice B
?????????????????????????? Choice C
??????????????????????????? Choice D
???????????????????
38
Ex2 ??????????????????????????????????????????????
??????? 7 ??????????????????????????
  • ???????????? ?????????? 50 ???
  • ?????????????????? 2 ????
  • ????????? ??????????????? 7
  • ??????????????????????????????????
    107 ???
  • ??????? Algorithm, Pseudo code, Flowchart

39
Ex3 ??????????????????????????????????????????????
???????????? ??????
  • ??????????????????????? ????????? 25 ???
  • ????????????????(OT) ????????? 40 ???
  • ????????
  • ???????????? ????????????????????? 8
  • ???????????? OT 3
  • ????????? ??????????????? 320

??????? Algorithm, Pseudo code, Flowchart
40
Ex4 ????????? ???????????????????????????????
?????????????????????????????? ??????????????????
? 0-100 ??? ????????? 5????????????? 101-200
??? ????????? 7????????????????? 200 ???
????????? 10?????????????????????????????????
41
Ex5 ??????????????? ?????????????????????????????
????????????? ????????
  • ?????????????
  • ?????????? 20 ???
  • ????????????? 30 ???
  • ?????????????????????????????? ?????? 50 ???
  • ???????????????
  • ?????????? 30 ???
  • ????????????? 40 ???
  • ?????????????????????????????? ?????? 60 ???
Write a Comment
User Comments (0)
About PowerShow.com