cs117 oop chapter 1 - dr. paween · 2019-04-02 · cs. 117 oop chapter 1. introduction to...
TRANSCRIPT
![Page 1: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/1.jpg)
CS117 OOPChapter 1
Introduction to Programming
By Dr. Paween KhoenkawComputer Science MJU
1
![Page 2: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/2.jpg)
17th century computer•The term "computer", in use from the early 17th century , meant "one whocomputes": a person performing mathematical calculations
•Early "computers" at work, summer 1949. In the terminology of that period, computers were employees--typically female--who performed the arduous task of transcribing raw data to standard engineering units.
•Computer Room
![Page 3: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/3.jpg)
ตามพจนานกรมฉบบราชบณฑตยสถาน พ.ศ. 2525
หมายถง เครองอเลกทรอนกสแบบอตโนมตทาหนาทเปน
เสมอนสมองกล ใชสาหรบแกปญหาตาง ๆ ทงทงายและ
ซบซอนโดยวธทางคณตศาสตร
•“คอมพวเตอร” หรอในภาษาไทยวา “คณตกรณ”
![Page 4: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/4.jpg)
โปรแกรมคอมพวเตอรคออะไร ?
4
โปรแกรมหรอชดคาสงทเขยนขนเพอบงคบและควบคมฮารดแวรของระบบคอมพวเตอร ใหทางานตามทตองการ
ลาดบขนตอนการทางานทเขยนดวยคาสงของคอมพวเตอร คาสงเหลานเรยงกนเปนโปรแกรมคอมพวเตอร
![Page 5: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/5.jpg)
คอมพวเตอรในยกตตน
![Page 6: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/6.jpg)
![Page 7: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/7.jpg)
![Page 8: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/8.jpg)
เครอง Analytical Engine ป ค.ศ.1834 แบบเบจไดพยายามเสนอ
การสรางเครองจกรกลชนดใหมเรยกวา Analytical Engine เพอตองการใหคานวณไดกบงานแทบทกชนดและตองทางานตามคาสงได
(programmable) โดยอาศยแนวคดของแจคการดทเอาบตรเจาะรมาชวยควบคมลวดลายการทอผาใหไดตามแบบ ทตองการนนเอง แบบรางของเครอง
Analytical Engine ทเขานาเสนอนจะอาศยองคประกอบในการทางานแบงออกเปนสวน ๆ ดงน
•Input Device อาศยบตรเจาะรในการนาขอมลเขาสตวเครอง
•Arithmetic Processor เปนสวนททาหนาทคานวณเพอหาผลลพธ
•Control Unit สาหรบคอยควบคมและตรวจสอบงานทจะนาออกวาไดผลลพธทถกตองหรอไม
•Memory เปนสวนสาหรบเกบตวเลขเพอรอการประมวลผล
![Page 9: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/9.jpg)
9
ววฒนาการของเครองคอมพวเตอร (ตอ)
Lady Ada Augusta Lovelace (1815 – 1852) ได
ทางานรวมงานกบ Babbage และไดเขยนชดคาสง
ลงในบตรเจาะรเพอควบคมการทางานของเครอง
Analytical Engine ไดรบการยกยองวาเปน
โปรแกรมเมอรคนแรกของโลก
Ada Augusta Lovelace
![Page 10: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/10.jpg)
10
George Boole (1815 – 1864)
นกคณตศาสตรชาวองกฤษ George Boole ไดคดระบบ
พชคณตแบบใหม คอ Boolean Algebraซงใชอธบาย
หลกเหตผลทางตรรกวทยาโดยใชสภาวะเพยง 2 อยาง
คอ 0 และ 1รวมกบเครองหมายในเชงตรรกะพนฐาน
ไดแก not, and และ or
ถอเปนกาเนดของระบบเลขฐานสอง และ Boolean Algebra กไดถกดดแปลง
ใหเขากบวงจรไฟฟาซงม 2 สถานะคอ เปดและปด จงนบเปนรากฐานของ
การออกแบบวงจรในระบบคอมพวเตอรปจจบน
ววฒนาการของเครองคอมพวเตอร (ตอ)
![Page 11: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/11.jpg)
1936 Turing MachineA Turing machine is a hypothetical device that manipulates symbols on a strip of tape according to a table of rules.
•Alan Turing
•Bombe Machine•Finite automata
![Page 12: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/12.jpg)
![Page 13: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/13.jpg)
ENIAC PROGRAMMER
13
![Page 14: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/14.jpg)
14
John Von Neumann นกคณตศาสตรไดคนพบวธการเกบโปรแกรมไวในเครองคอมพวเตอรพรอมทงการแปลงชดคาสง(โปรแกรม)ใหเปนรหสตวเลขฐานสอง ซงสามารถปรบเขาไดกบระบบวงจรไฟฟา
ชอวา EDVAC(Electronic Discrete Variable Automatic Computer) ขนมาจนสาเรจในป ค.ศ. 1949 และเรมใชงานจรงในป ค.ศ. 1951
ววฒนาการของเครองคอมพวเตอร (ตอ)
EDVAC
![Page 15: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/15.jpg)
15
EDVAC PROGRAMMER
![Page 16: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/16.jpg)
16
เทคโนโลยทาใหคอมพวเตอรมขนาดเลกลง
![Page 17: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/17.jpg)
17
ภาษาของเครองคอมพวเตอร
ภาษาทคอมพวเตอรเขาใจ คอเลขฐานสอง
“0” หมายถง ปด, “1” หมายถง เปด
เพอใหเขยนไดงาย เราจงนยมเขยนภาษาเครองเปนเลขฐาน 16
1111 0110 = F6
ตวอยางภาษาเครองของ หนวยประมวลผลเบอร 80386
b4 02 b2 49 cd 21 b2 03 cd 21 b2 55 cd 21 b4 4c cd 21
![Page 18: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/18.jpg)
18
PROGRAMMER: MARGARET HAMILTON
APOLLO MISSION
![Page 19: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/19.jpg)
19
ภาษาแอสเซมบล
เพออานวยความสะดวกในการเขยนโปรแกรม
จงมการใชตวอกษรแทนคาสงทเปนเลขฐาน16 เรยกวา Mnemonic
ภาษานเรยกวาภาษาแอสเซมบล (Assembly) โปรแกรมทใชแปลภาษาน
เปนภาษาเครองเรยกวา แอสเซมเบลอร (Assembler)
ตวอยางภาษาแอสเซมบล หนวยประมวลผลเบอร 80386mov ah,02mov dl,49int 21mov dl,03int 21mov dl,55int 21mov ah,4cint 21
Assembler ภาษาเครอง
![Page 20: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/20.jpg)
20
ภาษาระดบสง
เปนภาษาทมนษยเขาใจ
ภาษาระดบสงมอยมากมาย
•บางภาษาใชสงงานการคานวณทางคณตศาสตรและวทยาศาสตร
•บางภาษาใชสงงานทางดานการจดการขอมล
![Page 21: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/21.jpg)
21
ภาษาระดบสงในชวงแรก
- มนษยเขาใจงาย
- มโครงสราง
- แบงการทางานเปนสวนยอย
Fortran, ALGOL, COBOL, BASIC, Pascal, C, Go
![Page 22: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/22.jpg)
22
ภาษาระดบสงในชวงแรก
Complieror
Interpreterภาษาเครอง
![Page 23: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/23.jpg)
23
กระบวนทศน: Programming paradigm
Machine code Procedural languages Object-oriented programmingmov ah,02mov dl,49int 21mov dl,03int 21mov dl,55int 21mov ah,4cint 21
?
![Page 24: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/24.jpg)
24
Procedural languages
A = 4B = 1C = 1L1: B = B * CC = C+1IF C > A THEN GOTO L2GOTO L1L2: PRINT B
DATA
LOGIC
![Page 25: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/25.jpg)
25
Procedural languages
A = 4B = 1C = 1L1: B = B * CC = C+1IF C > A THEN GOTO L2GOTO L1L2: PRINT B
DATA
LOGIC
mov ah, 02mov dl, 49int 21mov dl, 03int 21mov dl, 55int 21mov ah, 4cint 21
![Page 26: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/26.jpg)
26
Procedural languages' Attribute 1redvalue(1) = 40greenvalue(1) = 10bluevalue(1) = 0
' Attribute 2redvalue(2) = 50greenvalue(2) = 15bluevalue(2) = 0
' Attribute 3redvalue(3) = 50greenvalue(3) = 20bluevalue(3) = 0
' Attribute 4redvalue(4) = 50greenvalue(4) = 25bluevalue(4) = 0
' Attribute 5redvalue(5) = 60greenvalue(5) = 35bluevalue(5) = 0
' Attribute 6redvalue(6) = 60greenvalue(6) = 40bluevalue(6) = 0
' Attribute 7redvalue(7) = 63greenvalue(7) = 50bluevalue(7) = 0
' Attribute 8redvalue(8) = 30greenvalue(8) = 60bluevalue(8) = 0
' Attribute 9redvalue(9) = 0greenvalue(9) = 40bluevalue(9) = 10
' Attribute 10redvalue(10) = 0greenvalue(10) = 30bluevalue(10) = 15
END SUB ' SetColorValues
' current MandY value to screen' coordinates and store that in' C2.
x = C1 ' Shift the value of C1 to X so that it may be maintained.y = C2 ' Shift the value of C2 to Y so that it may be maintained.
FOR n = 1 TO count ' Begin the iterations of the Mandelbrot' equation.
x1 = x * x - y * y + C1 ' Calculate the X value and store it' in x1.
y1 = 2 * x * y + C2 ' Calculate the Y value and store it' in y1.
r = x1 * x1 + y1 * y1 ' Calculate the distance from the' origin.
IF r > 4 THEN GOTO skipman ' If (c1, c2) tends toward infinity' exit the loop.
x = x1 ' Take the new value for x1 and shift it to x.y = y1 ' Take the new value for y1 and shift it to y.intervalcounter = n ' Set intervalcounter to the current
' interval number for use with' GetColorInterval
NEXT n ' Reiterate the Mandelbrot equation.
PSET (MandX + mandoffsetx, MandY + mandoffsety), 0: IF litemode1 = 1 THEN PaintColorGaugeBlack
' If the point remains within the 4 x 4' boundaries then color the point black' and color the gauge black.
skipman:
IF r > 4 THEN PSET (MandX + mandoffsetx, MandY + mandoffsety), GetColorInterval: IF litemode1 = 1 THEN PaintColorGauge
' If the point tends to infinity color it' based on the number of iterations of the' Mandelbrot equation.
q$ = UCASE$(INKEY$)IF q$ = CHR$(27) THEN EndProgram ' End program when the user presses
' Escape.IF q$ = " " THEN SWAP litemode1, litemode2: PaintLitemodeIndicator
' Turn litemode on or off, then indicate.
IF litemode1 = 1 THEN IF scantype = 1 THEN EraseScanLineIF litemode1 = 1 THEN IF scantype = 2 THEN PaintScanDot
NEXT MandY ' Loop to the next MandY value.NEXT MandX ' Loop to the next MandX value.
END SUB ' PaintMandelbrotSet
END SUB ' PaintIndicatorLights
SUB PaintLitemodeIndicator
IF litemode1 = 0 THEN LINE (6, 304)-(24, 317), 14, B: LIN
IF litemode1 = 1 THEN LINE (38, 304)-(63, 317), 14, B: LIN
END SUB ' PaintLitemodeIndicator
SUB PaintMainGraphic
'Picture Plus'by Chris Howie'1998,1999 Crazy Computers
SHELL "lppdgraf.exe" ' This is the program that loads the
END SUB ' PaintMainGraphic
SUB PaintMainMenu
SCREEN 12
PaintMainGraphic
LINE (9, 9)-(629, 169), , B
LOCATE 15PRINT " Create Image Load Set Edit Set
LINE (10, 220)-(630, 240), , B ' Line around menu choices
ch1x% = 67ch2x% = 255ch3x% = 435ch4x% = 610
CIRCLE (ch1x%, 280), 25 ' Choice indicator "lights".CIRCLE (ch1x%, 280), 24, 8CIRCLE (ch1x%, 280), 23CIRCLE (ch1x%, 280), 18, , 1.5, 3.7
CIRCLE (ch2x%, 280), 25CIRCLE (ch2x%, 280), 24, 8CIRCLE (ch2x%, 280), 23CIRCLE (ch2x%, 280), 18, , 1.5, 3.7
CIRCLE (ch3x%, 280), 25CIRCLE (ch3x%, 280), 24, 8CIRCLE ( h3 % 280) 23
DATA และ LOGIC จะปะปนกนอยางไมเปนระเบยบ
![Page 27: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/27.jpg)
27
กระบวนทศน: Programming paradigm
Machine code Procedural languages Object-oriented programmingmov ah,02mov dl,49int 21mov dl,03int 21mov dl,55int 21mov ah,4cint 21
class Point {
public int x = 0;
public int y = 0;}
class Test {
public static void main(String[] args) {
Point p = new Point();
System.out.println( " Value of x = " + p.x + “ Value of y = " + p.y);
}
}
![Page 28: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/28.jpg)
28
Object-oriented programming
DATA……………………………………………………………….
LOGIC……………………………………………………………….
OBJECT
OBJECT
OBJECT
OBJECT
OBJECT
OBJECT
Computer Program
![Page 29: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/29.jpg)
29
แงมม Procedural languages Object-oriented
programming
โปรแกรมขนาดเลก เขยนสน เขยนยาว
โปรแกรมขนาดใหญ เขยนยาว เขยนสน
การนา code กลบมาใชใหม นา code ทงหมดมาใส เรยกใชไดเลย
การนา code เกามาปรบใช ตองแก code เกา นามาใชไดเลย
อายของภาษา สวนมากเกากวา 20 ป สวนมากไมถง 20 ป
ความเรวของการทางาน เรว ชากวาเลกนอย
![Page 30: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/30.jpg)
30
Object-oriented programming
DATA……………………………………………………………….
LOGIC……………………………………………………………….
OBJECT
โปรแกรมแนว
Proceduralแยกสวน
จดรปแบบ
![Page 31: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/31.jpg)
31
Object-oriented programming
DATA……………………………………………………………….
LOGIC……………………………………………………………….
OBJECT
ในชวตจรง
เราจะแบงอยางไรวา อะไรคอ DATA และอะไรคอ LOGIC ?
![Page 32: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/32.jpg)
32
Attributes
Behavior
Things
ลกษณะจาเพาะ เชน ส กลน ความเรว อณหภม
พฤตกรรม เชน หลบ สงเสยง วง เลยว
![Page 33: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/33.jpg)
33
2
Attributes and Behavior
Car
Cat
Attributes Behavior
License plateMakeModelYearColor
StartStopTurnAccelerateFlash lights
NameBreedColorAgeWeight
SleepEatPurrClimbScratch
![Page 34: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/34.jpg)
34
34
Attributes and Behavior
Car
Cat
Attributes Behavior
License plateMakeModelYearColor
StartStopTurnAccelerateFlash lights
NameBreedColorAgeWeight
SleepEatPurrClimbScratch
Properties MethodsDATA LOGIC
JAVA
![Page 35: CS117 OOP Chapter 1 - Dr. Paween · 2019-04-02 · CS. 117 OOP Chapter 1. Introduction to Programming. By Dr.Paween Khoenkaw. Computer Science MJU. 1](https://reader035.vdocuments.site/reader035/viewer/2022063006/5fb6146798baf15bf672ddaf/html5/thumbnails/35.jpg)
การบานท 1
35
แยก Attribute และ Behavior ของ “Smartphone”
มาอยางละ 5 ขอ
SmartPhone
Attributes Behavior
1….2….3….4….5….
1….2….3….4….5….
เขยนคาตอบใสกระดาษ A4 ตดครงสงทางกลองรบการบาน หนาแลป 2เขยนชอ รหส กลมเรยน ทมมบนขวา
ภายในวนศกรท 23 มถนายน 2560