tag:blogger.com,1999:blog-18233864311679027552024-03-07T23:04:14.057-08:00CPL AssignmentAnonymoushttp://www.blogger.com/profile/07976923875403114416noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-1823386431167902755.post-8811705800461403772013-04-08T08:24:00.002-07:002013-04-08T08:24:40.923-07:00Concepts of Programming Languages - Chapter 7Review Questions<br />
2. Operator that has three operands.<br />
3. Operator that precede its operands.<br />
4. Exponentiation operator.<br />
11. Multiple use of an operator.<br />
18. Short circuit evaluation is one in which the result is determined without evaluating all of the operands and/or operators.<br />
25. Ada doesn't allowed mixed mode assignment.<br />
26. Mixed mode assignment are allowed in Java only if the required coercion is widening.<br />
<br />
Problem Set<br />
5. No, it shouldn't be included in other language because in C there are some characteristics assigning operations that available just in C language, in case that the assigning operator in C make it unique and different from the other language.<br />
6. No, it shouldn't be included in other language because in C there are some characteristics single operand assignment forms that available just in C language, in case that the single operand assignment forms in C make it unique and different from the other language.<br />
9.<br />
a. ( ( (a*b)1 -1 )2 +c)3<br />
b. ( ( ( a* (b-1)1 )2 /c)3 mod d)4<br />
c. ( ( ( ( ( (a-b)1 /c)2 (d*e)3 /a)4 -3)5 &)6<br />
d. (- ( ( (a or c)1 (d and e) )2 = )3 )4<br />
e. ( ( ( (a>b)1 xor c )2 or (d<=17) )3<br />
f. (- (a+b)1 )2<br />
15. Because C is a structured programming language that makes C must read every line on that code, so if there is a simple error it will be detected immediately, in that case it makes C difficult to eliminate its functional side effect.<br />
21. Because Java is using associativity rules of the language that makes Java read an expression from left to right.Anonymoushttp://www.blogger.com/profile/07976923875403114416noreply@blogger.com0tag:blogger.com,1999:blog-1823386431167902755.post-51075736208266742192013-04-08T06:39:00.003-07:002013-04-08T06:39:52.337-07:00Concepts of Programming Languages - Chapter 6Review Questions<br />
1. Collection of the attributes of a variable.<br />
3.<br />
Should strings be simply a special kind of character array or a primitive type ?<br />
Should strings have static or dynamic length ?<br />
5. Ordinal is one in which the range of possible values can be easily associated with the set of positive integers. Enumeration is one in which all of the possible values, which are named constants, are provided, or enumerated, in the definition. Subrange is a contiguous subsequence of an ordinal type.<br />
8.<br />
What types are legal for subscripts ?<br />
Are subscripting expressions in element references range checked ?<br />
When are subscript ranges bound ?<br />
When does array allocation take place ?<br />
Are ragged or rectangular multidimensioned arrays allowed, or both ?<br />
Can arrays be initialized when they have their storage allocated ?<br />
What kinds of slices are allowed, if any ?<br />
11. The subscript values need not be contiguous.<br />
12. Ruby and Lua.<br />
17. In row major order the elements of the array that have as their first subscript the lower bound value of that subscript are stored first, followed by the elements of the second value of the first subscript, and so forth. In column major order, the elements of an array that have as their last subscript the lower bound value of that subscript are stored first, followed by the elements of the second value of the last subscript, and so forth.<br />
31. Union is a type whose variables may store different type values at different times during program execution. Free union is the unions in C and C++ which are allowed complete freedom from type checking in their use. Discriminated union is a union with a discriminant.<br />
33. Yes, they are<br />
35.<br />
What are the scope and lifetime of a pointer variable ?<br />
What is the lifetime of a heap-dynamic variable (the value a pointer references) ?<br />
Are pointers restricted as to the type of value to which they can point ?<br />
Are pointers used for dynamic storage management, indirect addressing, or both ?<br />
Should the language support pointer types, reference types, or both ?<br />
36. Dangling pointers and Lost Heap-Dynamic variables<br />
38. A C++ reference type variable is a constant pointer that is always implicitly dereferenced, used primarily for the formal parameters in function definitions.<br />
44. Type error is the application of an operator to an operand of an inapropriate type.<br />
50. Name type equivalence means that two variables have equivalent types if they are defined either in the same declaration or in declarations that use the same type name.<br />
<br />
Problem Set<br />
2. A negative integer could be stored in sign-magnitude notation, in which the sign bit is set to indicate negative and the remainder of the bit string represents the absolute value of the number. Sign-magnitude notation, however, doesn't lend itself to computer arithmetic. Most computers now use a notation called twos complement to store negative integers, which is convenient for addition and subtraction. In twos-complement notation, the representation of a negative integer is formed by taking the logical complement of the positive version of the number and adding one. Ones-complement notation is still used by some computers. In ones-complement notation, the negative of an integer is stored as the logical complement of its absolute value. Ones-complement notation has the disadvantage that it has two representations of zero.<br />
7. C++ pointer used in the same way as address, can point at any variables, C++ reference type variable is a pointer that is implicity dereferenced and constant.<br />
<br />
8. in C++ is a constant, must be initialized with the address of variable, after initialization a variable that pass by reference can't be set to the other variable, in Java variable can be assigned to reference, and it isn't constant.<br />
<br />
21. Dynamic type better than static type to detect error in compile time than in run time.<br />
22. Take deallocation of heap dynamic variable out, because if a program can''t deallocate heap dynamic variable explicitly, it won't be any dangling pointer.Anonymoushttp://www.blogger.com/profile/07976923875403114416noreply@blogger.com0tag:blogger.com,1999:blog-1823386431167902755.post-24706985038846684202013-04-07T21:19:00.001-07:002013-04-07T21:19:09.328-07:00Concepts of Programming Languages - Chapter 5Review Question<br />
1. Are name case sensitive ? Are the special words of the language reserved words or keywords ?<br />
4. Two or more variables name that can be used to access the same memory location.<br />
5. Two pointers variables are aliases when they point to the same memory location.<br />
7. Binding is an association between an attribute and an entity. Binding time is the time which binding takes place.<br />
9. Static binding if it first occurs before run time begins and remain s unchanged throughout program execution Dynamic binding if the binding first occurs during run time or can change in the course of program execution.<br />
18. Such variables are typically stack dynamic, so their storage is allocated when the section is entered and deallocated when the section is exited.<br />
<br />
Problem Set<br />
1. Student , Student123 because in C we can't use _ ,etc. and begin it with number for the variables name.<br />
4. Because a variable must have data type before it assigned. Range int type in Java -2,147,483,648 to +2,147,483,648.<br />
10.<br />
1 -> a,b,c (definition 1)<br />
2 -> a (definition 1) b (definition 2) c,d,e (definition 3)<br />
3 -> a (definition 1) b,c d (definition 2)<br />
4 -> a,b,c (definition 1)<br />
<br />Anonymoushttp://www.blogger.com/profile/07976923875403114416noreply@blogger.com0tag:blogger.com,1999:blog-1823386431167902755.post-44164978218430870552013-03-31T21:29:00.001-07:002013-03-31T21:29:07.986-07:00Concepts of Programming Languages - Chapter 3<br />
<div class="MsoNormal">
<span lang="EN-GB">Review
Questions<o:p></o:p></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-GB">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Syntax
is the form of programming language expressions, statements, and program units.
Semantics is the meaning of those expressions, statements, and program units.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">7. Brackets,
braces, multiple-choice options.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">9. State
the static semantic rules of the language.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">12. To
provide complete descriptions of the syntax and static semantics of programming
languages.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">14. The
individual steps in the execution of machine language and the resulting changes
to the state of the machine are too small and too numerous, and the storage of
a real computer is too large and complex.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">16. Syntactic
domain is the domain that syntactic structures are mapped, semantic domain is
the range of the map.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">18. Denotational
semantics<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">27. Loop
invariant is the corresponding step in the axiomatic semantics of a while loop
is finding an assertion. Example: I is the loop variant<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">P=> I<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">{I and B} S{I}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">(I and (not B)) => Q<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">28. To
treat the process of producing a weakest precondition as a function, because it
takes a predicate, or assertion, as a parameter and returns another predicate.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB">29. Total correctness is if loop termination
can be shown, partial correctness if the other conditions can be met but
termination isn’t guaranteed.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 18.0pt;">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">Problem Set<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-GB">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">A
syntax error is an error in the typing of the code or statement, and a semantic
error is a logic error.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle">
<span lang="EN-GB">scanf(%d,&a); >> syntax error because in %d it should be start
and end with “<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast">
<span lang="EN-GB">char asd[50]; char asd2[25]; printf(“%d”,asd); >> logic error
because it is a string data type but it print out with integer data type</span></div>
<div class="MsoListParagraphCxSpLast">
<span lang="EN-GB"><br /></span></div>
<div class="MsoListParagraphCxSpLast">
<span lang="EN-GB">3.</span></div>
<div class="MsoListParagraphCxSpLast">
<span lang="EN-GB"></span></div>
<div class="MsoNormal">
<assign> <span lang="ZH-CN" style="font-family: SimSun; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">→</span>
<id> = <expr><o:p></o:p></div>
<div class="MsoNormal">
<id> <span lang="ZH-CN" style="font-family: SimSun; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">→</span> A | B
| C<o:p></o:p></div>
<div class="MsoNormal">
<expr> <span lang="ZH-CN" style="font-family: SimSun; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">→</span>
<expr> + <term><o:p></o:p></div>
<div class="MsoNormal">
|
<term><o:p></o:p></div>
<div class="MsoNormal">
<term> <span lang="ZH-CN" style="font-family: SimSun; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">→</span>
<term> * <factor><o:p></o:p></div>
<div class="MsoNormal">
| <factor><o:p></o:p></div>
<div class="MsoNormal">
<factor> <span lang="ZH-CN" style="font-family: SimSun; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: SimSun; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">→</span> (
<expr> )<o:p></o:p></div>
<div class="MsoNormal">
| <id><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoListParagraphCxSpLast">
<span lang="EN-GB">13. S->ab | aSb</span></div>
<div class="MsoListParagraphCxSpLast">
<span lang="EN-GB"> b->bb</span></div>
<div class="MsoListParagraphCxSpLast">
<span style="font-family: Calibri, sans-serif;"><span style="font-size: 15px; line-height: 16px;">15.</span></span></div>
<div class="MsoListParagraphCxSpLast">
<program>
-> begin <stmt_list> end</div>
<div class="MsoNormal">
<stmt_list> -> <stmt><o:p></o:p></div>
<div class="MsoNormal">
| <stmt> ; <stmt_list><o:p></o:p></div>
<div class="MsoNormal">
<stmt> -> <var> = <expression></div>
<div class="MsoNormal">
<var> -> A | B | C</div>
<div class="MsoNormal">
<expression> -> <var> {(+|-) <var>}<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
16.</div>
<div class="MsoNormal">
<expression> -> <var> {(+|-) <var>}</div>
<div class="MsoNormal">
<assign> -> <id> = <expr></div>
<div class="MsoNormal">
<id> -> A | B | C</div>
<div class="MsoNormal">
<expr> -> <expr> {(+|*) <expr>}</div>
<div class="MsoNormal">
| <id><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
18. Fully attributed parse tree is a condition of a parse tree
when all the attribute values in it have been computed.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
23.</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
a.<o:p></o:p></div>
<div class="MsoNormal">
a = 2 * ( b – 1 ) – 1 { a > 0 }<o:p></o:p></div>
<div class="MsoNormal">
a = 2b – 2 – 1 { a > 0 }<o:p></o:p></div>
<div class="MsoNormal">
a = 2b – 3 { a > 0 }<o:p></o:p></div>
<div class="MsoNormal">
2b – 3 > 0<o:p></o:p></div>
<div class="MsoNormal">
2b > 3<o:p></o:p></div>
<div class="MsoNormal">
b > 3/2<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
b.<o:p></o:p></div>
<div class="MsoNormal">
b = ( c + 10 ) / 3 { b > 6 }<o:p></o:p></div>
<div class="MsoNormal">
b = c / 3 + 10 / 3 { b > 6 }<o:p></o:p></div>
<div class="MsoNormal">
c / 3 + 10 / 3 > 6<o:p></o:p></div>
<div class="MsoNormal">
c + 10 > 18<o:p></o:p></div>
<div class="MsoNormal">
c > 8<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
c.<o:p></o:p></div>
<div class="MsoNormal">
a = a + 2 * b ? 1 { a > 1 }<o:p></o:p></div>
<div class="MsoNormal">
a = a + 2b – 1 { a > 1 }<o:p></o:p></div>
<div class="MsoNormal">
a + 2b – 1 > 1<o:p></o:p></div>
<div class="MsoNormal">
2b > 2 – a<o:p></o:p></div>
<div class="MsoNormal">
b > 1 – a/2<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
d.<o:p></o:p></div>
<div class="MsoNormal">
x = 2 * y + x ? 1 { x > 11 }<o:p></o:p></div>
<div class="MsoNormal">
x = 2y + x – 1 { x > 11 }<o:p></o:p></div>
<div class="MsoNormal">
2y + x – 1 > 11<o:p></o:p></div>
<div class="MsoNormal">
2y > 12 – x<o:p></o:p></div>
<div class="MsoNormal">
y > 6 – x/2<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
24.</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
a.<o:p></o:p></div>
<div class="MsoNormal">
a = 2*b+1;<o:p></o:p></div>
<div class="MsoNormal">
b = a – 3<o:p></o:p></div>
<div class="MsoNormal">
{ b < 0 }</div>
<div class="MsoNormal">
a – 3 < 0<o:p></o:p></div>
<div class="MsoNormal">
a < 3</div>
<div class="MsoNormal">
a = 2 * b + 1 { a < 3 }<o:p></o:p></div>
<div class="MsoNormal">
2b + 1 < 3<o:p></o:p></div>
<div class="MsoNormal">
2b < 2<o:p></o:p></div>
<div class="MsoNormal">
b < 1<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
b.<o:p></o:p></div>
<div class="MsoNormal">
a = 3*( 2*b+a );<o:p></o:p></div>
<div class="MsoNormal">
b = 2*a – 1<o:p></o:p></div>
<div class="MsoNormal">
{ b > 5 }</div>
<div class="MsoNormal">
2a – 1 > 5<o:p></o:p></div>
<div class="MsoNormal">
2a > 6<o:p></o:p></div>
<div class="MsoNormal">
a > 3</div>
<div class="MsoNormal">
a = 3 * ( 2 * b + a) { a > 3 }<o:p></o:p></div>
<div class="MsoNormal">
3 * ( 2b + a ) > 3<o:p></o:p></div>
<div class="MsoNormal">
2b + a > 1<o:p></o:p></div>
<div class="MsoNormal">
2b > 1 – a<o:p></o:p></div>
<div class="MsoNormal">
B > ( 1 – a ) / 2<o:p></o:p></div>
<br />
<br />
<div class="MsoNormal">
<o:p></o:p></div>
Anonymoushttp://www.blogger.com/profile/07976923875403114416noreply@blogger.com0tag:blogger.com,1999:blog-1823386431167902755.post-18061707878626198802013-03-10T06:53:00.003-07:002013-03-10T06:53:34.839-07:00Concepts of Programming Languages - Chapter 2<br />
<div class="MsoNormal">
<span lang="EN-GB">Review
Question<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">7. John Backus<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">8. John Mauchly<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">10. The Independent compilation of subroutines<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">12. Fortran IV<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">13. Fortran 77<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">17. Scheme<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">23. 1959<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">27. It was easy for beginners to learn,
especially those who were not science oriented, and its smaller dialects can be
implemented on computers with very small memories.<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">30. Class construct<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">33. ALGOL-W<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">34. For, switch<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">37. Facts, rules<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">44. Smalltalk<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">45. Traditional Object-oriented programming<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">52. Params<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">65. XML data document and XSLT document<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB">68. Servlet<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Problem Set<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">1. Explicit type declarations for variables,
logical if construct, capability of passing subprograms as parameters to other
subprograms<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">2. Short code was one of the successful stored
program electronic computers, transferred to UNIVAC I computer, consist of
coded versions of mathematical expressions that were to be evaluated. Short
code wasn’t translated to machine code, it was implemented with a pure interpreter.
It simplified the programming process, but at the expense of execution time.
Because of that hand calculator is 50 times faster than short code<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">9. The purpose is to make easier for declaring
a variable<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">10. Introducing concept of block structure, pass
by value and pass by name to subprograms were allowed, procedures were allowed
to be recursive, stack-dynamic arrays were allowed<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">13. C is well suited for a wide variety of
applications<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">15. Yes, there are like VB, SQL<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">24. Because nowadays network users are increase
day by day, because of that reason people want to make scripting languages for
helping web programmer to handle that case1<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-GB">25. Java servlet is server-side Java program
modules that process and answer client requests and implement the servlet
interface<o:p></o:p></span></div>
Anonymoushttp://www.blogger.com/profile/07976923875403114416noreply@blogger.com0tag:blogger.com,1999:blog-1823386431167902755.post-67059090093923389782013-03-03T01:11:00.002-08:002013-03-03T01:11:40.804-08:00Blog's purpose post entryHi , I'm Felix Kantio Hardhy Saputra (1601234751) from class 02PCT.<br />
<br />
I make this blog especially for submit my assignment to Mr. <b>Tri Djoko Wahjono</b> for Concept of Programming Languages 02PCT class.Anonymoushttp://www.blogger.com/profile/07976923875403114416noreply@blogger.com0tag:blogger.com,1999:blog-1823386431167902755.post-43927476649620329382013-03-03T01:04:00.000-08:002013-03-03T01:05:28.501-08:00Concepts of Programming Languages - Chapter 1<br />
<div class="MsoNormal">
<span lang="EN-GB">Review
Questions<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Because
it can increase our capacity to use different constructs in writing programs,
enables us to choose languages for projects more intelligently, and makes
learning new languages easier.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">It
makes us better in understanding of the significance of implementation, in use
of languages that are already known.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Fortran<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">4.<span style="font-size: 7pt;"> </span></span><!--[endif]--><span lang="EN-GB">COBOL<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">5.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">LISP<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">6.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">C<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">7.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Disadvantage
of having too many features are make the users confused about what features
will they used for solving problems, and
not all of the features will be used by the user<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">8.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Operator
overloading means that a single operator symbol has more than one meaning, it
can lead to reduced readability if users are allowed to create their own
overloading and don’t do it sensibly, and it would make the program more
confusing for both the author and the program’s reader.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">9.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">In
case structured data type (record and array), record can be returned from
function but arrays can’t. Parameters are passed by value, unless they are
arrays, in case they are, in effect, passed by reference.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">10.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">ALGOL
68<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB">Problem Set<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Yes,
because when we want to make an algorithmic step for a program at least we can
tell what kind of function will be used by us to make the program, so we can
create and test the program as soon as we can after we have done with the
algorithm.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Ada
Lovelace<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Disadvantages
of multiple programming languages are sometime we could forget or confused in
using the function in some type of languages, lack of time to study all of
languages<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">4.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Scientific
applications support for scientist and for complicated calculation, but can be
used in business too sometimes, but languages for business applications support
for economical purpose and can’t be used by scientist for calculating formulas
and kinds of complicated calculation.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">5.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Languages
for artificial intelligence are developed in type of software and mostly used
for programming an artificial things, language for web software are designed
for make web content, HTML type.<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;">
<span lang="EN-GB"><br /></span>
<span lang="EN-GB">6.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span lang="EN-GB">Reliability,
because when a program is said to be reliable it include overall criteria of a
good program such as simplicity, orthogonality, readability, writability, etc.
And it has a lower cost<o:p></o:p></span></div>
Anonymoushttp://www.blogger.com/profile/07976923875403114416noreply@blogger.com0