برنامه سازی ساخت یافته پاسکال
DESCRIPTION
برنامه سازی ساخت یافته پاسکال. فهرست مطالب. فصل اول : مقدمه ای بر کامپیوتر و برنامه سازی فصل دوم : پاسکال و حل مساله فصل سوم : توابع و رویه ها فصل چهارم : ساختارهای انتخاب : دستورات if و else فصل پنجم : حلقه های تکرار : ستورات while و for و repeat - PowerPoint PPT PresentationTRANSCRIPT
-
: : : : : if else : : while for repeat : : : : : : : :
. . .
. . .
:
. . . 0 1 .
. . .
: () ( )
(CPU) CPU :
1- 2-
(CPU) CPU ( .) . .
. . .
. . .
.
.
.
.
.
.
.
. :
. 0 .
. C C++ .
.
.
:
1- .2- ().3- ( 1 ) .4- .
. .
:
.
:1) 2) 3)
( 4 ) .
. ( ) .
.
:
.
begin .
var , const , end , begin . . . .
:
WEITELN READLN .... .
.
:
. . . . .
.
Integer +32767 -32768 . 26 -3714
Real . . 16.737 -3.725
char . a *
Boolean False true .
const var . :CONSTX=14.26 ;Y= * ;Z= January ;VARP,Q : REAL ;S : CHAR ;V,W,R: Boolean;D : integer ;
. :X : = Y * Z ;
.
Variable := expression ;
/ :
/ . WRITELN READLN .
:
READLN (X , Y);Z:= X + Y ; WRITELN (Z) ;
Pascal ; . . }{ . :Program Name (Input , Output) ; Const Constant = value ; . . . constant = value ; var variable list : type ; . . . variable list : type ; begin statement ; .. . statement end .
. :
Integer / Integer Real .
:
/ Real . Real Integer Real ( 5+2.0 7.0 7 ).
1) : . ( ) .2) : :*, / , div , mod + , - 3) : ( + - ) .
* . . .
:
b2- 4ac
a + b c
ax ( b + c )
1 1+x2b * b 4 * a * c
a + b c
a * ( - ( b + c ) )
1 / ( 1+ x * x)
Integer . fw .
: Write ( your coins are worth , Dollars :1, dollars ) ;Writeln ( and , change: 2 , cents. ) ;
( :fw :dp ) . . ( ) .
. . .
:
*
*
aces
aces
aces:1
:2
:1
:4
:5*
2
a
aces
aces
. () . .
. .
. . . Sqrt .
Y : = SQRT (X)
real integer Abs (x)Realreal integer Arctan(x)Realreal integer Cos(x)Realreal integer Exp(x)Realreal integer Ln(x)integerrealRound(x) real integer Sin(x)Realreal integer Sqr(x)Realreal integer Sqrt(x)integerrealTrunc(x)
. .
: . .
: :
Draw Triangle ; { Draw a triangle . }
( Draw Triangle ) .
.
. . . .
. ( ) ( ) .
: : Writeln ( The area is , Area :4:2) : . writeln ( ).
: if else
IF else if Case otherwise else ( )
. .
:Begin Statement1: Statement2 : . . . Statementnend
. :Const X = true; x true .
: Var Y , z : Boolean;Y ,z .
: Variable relational-operator Variable Variable relational-operator constant
:> < =
: . .
not , or , and . :(x < y ) or (y > 5) . . :X and (not y)
and
or
not
. :
IF IF . IF .
:IF GROSS > 100.00 THEN NET := GROSS TAX ELSE NET :=GROSS
if :
If condition then Statement- : If x> 0.0 then Posprod := posprod * x
if :If condition then Statementt Else Statementf : If x >= 0.0 then Write (positive) Else write (negative)
else if else if else . if else . .
:If x > 0 thenIf y > x thenWriteln( y >x>0)ElseWriteln( (x>0) and (y