...
This presentation is the property of its rightful owner.
Sponsored Links
1 / 43

องค์ประกอบของคอมพิวเตอร์ และการโปรแกรม PowerPoint PPT Presentation


  • 121 Views
  • Uploaded on
  • Presentation posted in: General

องค์ประกอบของคอมพิวเตอร์ และการโปรแกรม. โดย รองศาสตราจารย์ธีรวัฒน์ ประกอบผล. คำถาม. อยากเป็นนักเขียนโปรแกรมจะเรียนอะไรดี รุ่นใหม่ออกแล้ว คุณเปลี่ยนหรือยัง จะใช้คอมพิวเตอร์ในชุมชนของเรา ใช้อะไรดี. องค์ประกอบของคอมพิวเตอร์. Hardware Software People Data. โครงสร้างคอมพิวเตอร์.

Download Presentation

องค์ประกอบของคอมพิวเตอร์ และการโปรแกรม

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


5382650


5382650


5382650

  • Hardware

  • Software

  • People

  • Data


5382650


5382650

  • (ASCII)

  • BCD

    (Parity)


5382650

  • Hardware

  • BIOS

  • (Operating System)


5382650


5382650

1.

2.

3.

4.

5.


5382650

  • (Low-level Language)

  • (High-level Language)


Pascal

(Pascal)

  • Compiler


5382650

PROGRAM name;

USES

CONST

TYPE

VAR

PROCEDURE OR FUNCTION

BEGIN

END.


5382650

1

PROGRAM TEST1;

BEGIN

WRITELN(COMPUTER);

WRITELN(I LOVE YOU );

END.


5382650

2

PROGRAM TEST1;

USES CRT;

VAR A : INTEGER;

BEGIN

A := 5;

WRITELN(A);

WRITELN(NUMBER = ,A)

WRITELN(NUMBER = ,A+2);

END.


5382650

CONST

=

EX..

WORKINGDAYS = 5;

PI = 3.14159;


5382650

VAR

:

EX.

X : Char;

A,B : INTEGER;

C : Real;


Reserved word

(Reserved Word)

ANDDOMODPROCEDURETOARRAY

TYPEELSEGOTOFUNCTIONBEGINUNTIL

ENDIFORNOTTHENVAR


5382650

1. (Simple-type data)

1.1 (Standard data types)

1.2 (uses define ordinal types)

2. (Structure-type data)

3.


5382650

1. (Integer)

2. (Real)

3. (Char)

4. (Boolean)


5382650

  • Integer2 -32768..32767

  • Real6 2.9 E-39 .1.7 E +38

  • Char1

  • Boolean1


5382650

VAR

MONTH : (JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,

NOV,DEC);

COLOR : (RED,YELLOW,BLUE);

MONTH := MAY;

COLOR := YELLOW;


5382650

  • (Sequence Structure)

  • (Selection Structure)

  • (Case structure)

  • (Do While Structure)

  • (Do Until Structure)


5382650

X

Y

Z


5382650

T

F

IF

THEN A

ELSE B

A

B


5382650

T

F

IF

THEN A

A


Case structure

(Case Structure)

T

F

A

B


Do while

(Do While)

A

T

F


Do until

(Do Until)

A

F

T


Relational operator

(Relational Operator)


4 not and or xor

4 not and or xor


5382650

Case

caseSelectorOf

Constant_1 :Statement_1 ;

Constant_2 :Statement_2;

..

..

Constant_n :Statement_n;

else

Default_Statement;

end;


5382650

Readln(MonthNo);

if(MonthNo < 0) or (MonthNo > 12) then

Writeln(Invalid month number)

else

Begin

Write(Month name is );

Case MonthNo of

1 : Writeln(January );

End; {end case)

End;


5382650

Readln(Score);

If (Score >= 0) and (Score <= 100) Then

Begin

Case Score Of

90..100: Grade := A;

80..89: Grade := B;

70..79: Grade := C;

60..69: Grade := D;

else

Grade := F

End;


5382650

For

For Control_value := Initial_value To Final_value Do

Statement;

Control_value


5382650

  • For I := 1 TO 5 Do

    Write(I);

  • For I := 1 To 12 DO

    Writeln(2 x,I, = ,2*I);

  • VAR ch : Char;

    BEGIN

    For ch := A To Z Do

    Write(ch);


5382650

PROGRAM TEST;

VARI , J:Integer;

BEGIN

FOR I := 1 TO 2 DO

FOR J := 1 TO 3 DO

WRITELN(I:4 , J:4);

END.


5382650

VAR X , Y : INTEGER;

BEGIN

FOR X := 2 TO 8 DO

BEGIN

FOR Y := 1 TO 12 DO

WRITELN(X, x ,Y, = ,X*Y);

READLN;

END;

END.


Repeat repeat statement

Repeat (Repeat Statement)

Until

REPEAT

UNTIL


5382650

VARCount : Integer;

BEGIN

Count := 0;

REPEAT

WriteLn( I Love You );

Count := Count + 1;

UNTIL Count = 5;

END.


5382650

VARCh : Char;

BEGIN

Ch := A;

REPEAT

Write(Ch);

Ch := Succ(Ch);{}

UNTIL Ch > Z;

END.


While while statement

WHILE (While Statement)

WHILE

DO


5382650

VARCount : Integer;

BEGIN

Count := 1;

WHILE Count <= 5 DO

BEGIN

WriteLn(I Love YOU HA HA );

Count := Count + 1;

END;

END.


5382650

VARChoice : Integer;

BEGIN

WriteLn( Number Processing );

WriteLn(1.. ADD );

WriteLn(2.. SUB );

WriteLn(3.. MUL );

WriteLn(4.. DIV );

Write( Select (1,2,3,4) );

ReadLn(Choice);

WHILE (Choice <0 ) OR (Choice > 4) DO

BEGIN

Write(Select (1,2,3,4) );

ReadLn(Choice);

END;

.

.

END.


5382650

1. 1 300

2. 1 300 3 5

3. 10

4. Y = 3X2 + 8X + 1 Y X 0 10

5. 400

6. 4 Y X

7.


  • Login