if then if then e1 else e2 endif else e2 endif by keegan-mcdowell 109 slideshows follow user 66...

Download if then if then E1 else E2 endif else E2 endif By keegan-mcdowell 109 SlideShows Follow User 66 Views Presentation posted in: General

If you can't read please download the document

Upload: keegan-mcdowell

Post on 30-Dec-2015

69 views

Category:

Documents


1 download

DESCRIPTION

1. 假設以下的敘述為一未提供“捷徑計算”能力的程式段,試用程式設計的技巧,使此敘述經此改寫的動作後,具有與“捷徑計算”之處理方法相同之處理模式。 if and then E1 else E2 endif. if then if then E1 else E2 endif else E2 endif. (1) 寫出兩種布耳表式 (boolean expression) 之 AND 與 OR 兩運算子 (operator) 運算方式並比較兩方法之主要優缺點。 - PowerPoint PPT Presentation

TRANSCRIPT

  • 1.

    if and then E1 else E2 endif

  • if then if then E1 else E2 endifelse E2endif

  • (1)(boolean expression)ANDOR(operator)(2)ADACPascal

  • (1)a.(short circuit evaluation) (a)A and B AfalseA and Bfalse(b)A or B AtrueA or Btrueb.(complete circuit evaluation) (a)A and B AfalseBfalse(b)A or B AtrueBtruec.

  • (2)a.ADAandorand thenor elseb.Cc.Pascal

  • C(optimization compiler)(boolean operator)(sub-expression)

  • C

  • (recursive call)

  • SNOBOLAPLLISPPascalFORTRANCOBOL

  • (1)FORTRANPascalCOBOL(2)SNOBOLAPLLISPPascal

  • (1)(static type binding)(dynamic type binding)(2)FortranPascalLispAPLSmalltalk

  • (1)FortranPascal(2)LispAPLSmalltalk

  • (variable)5-tupletuples

  • (1)name(2)scope(3)type(4)l-value(5)r-value

  • 1.(attribute)(binding)(A)(dynamic binding) (B)(static binding) (C)(early binding) (D)(random binding)

  • 2.(Attribute)(binding)(A)(dynamic binding) (B)(static binding) (C)(early binding) (D)(random binding)

  • 3.(variables) (A)(name) (B)(value) (C)(error message) (D)(attribute)

  • 4.(data binding)(compile time)(A)LISP (B)PROLOG (C)Pascal (D)APL

  • 5. (A)APL (B)BASIC (C)C (D)PL/16.(dynamic binding type) : LispSchemeC++Java(A)1 (B)2 (C)3 (D)4

  • 7.(array)(heap dynamic)(A)FORTRAN 77 (B)Pascal (C)Ada (D)FORTRAN 9O8.APLL1,2,3,4,5,6L38(storage binding)(A)(static) (B)(static dynamic) (C)(explicit-dynamic variable) (D)(implicit-dynamic variable)

  • 9.(static binding type)ADACFORTRANAPL (A)1 (B)2 (C)3 (D)4 10.(expression)(type checking)(coercion)(A)ADA (B)C (C)C++ (D)FORTRAN