0% found this document useful (0 votes)
4 views

Concepts 2023_

The document is a final term exam for the Computer Science Department at Suez Canal University, consisting of multiple-choice and true/false questions covering various programming languages and concepts. Topics include language characteristics, parameter passing, data types, and scoping rules. The exam is structured to assess students' understanding of computer science principles and programming languages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
4 views

Concepts 2023_

The document is a final term exam for the Computer Science Department at Suez Canal University, consisting of multiple-choice and true/false questions covering various programming languages and concepts. Topics include language characteristics, parameter passing, data types, and scoping rules. The exam is structured to assess students' understanding of computer science principles and programming languages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 6
Suez Canal University Faculty of Computers and Informatics Department of Computer Science Final Term Exam way TEX Program: CS] se Code: CS303_ Program: CS Dur Level: 3 Jan. 24, 20; Total Pages: 6 | Total aswer the following Questions: uuestion [1]: Choose the correct answer: (25 marks} LFORTRAN is a language designed for....... A-Systems Programming B- Busines D- Antficial Intelligence 2. C# language Genealogy is a combination A-TAVA and SIMULA B- SIMULA and C+. C- RUBY and BASIC 3. SCHEME language is derived from... language “LISP B-ML C- HASKELL D- otherwise 4. The characteristics of readability includes, .. A: Expressivity B- Simplicity C- Orthogonality /D- B. andC 5. There are ... characteristics of reliability. PO eo 15 ees 6° Language Evaluation Criteria do not include A- Cost B- Portability C- Generality 2 Orthogonality 7. The number of Influences on Language Design is. A382 C4 D5 8. Decoding the instruction is the . | 3% B. 2c. 4h p. ye AW Object-oriented programming appeared in... A- 1990's B- 1970's € 1980's D- 1960's 10-The language(s) which is/are not imperative is/are... A® Prolog B-C++ C- java D- Fortran quage has powerful writability at the cost of Applications @ Scientific Applications of the characteristics of both ......languages p JAVA and visual BASIC step in the Fetch-execute-cycle, Lr et «| & £4... readability. of layers of computer is..... Bice p23 tion and fast execution are the characteristics of ..... tation B- Hybrid ea D- Otherwise Page 1of6. “ difficulty making wp names, that are not reserved, in Nan petoet Cada PASCAL 'S The association berween « variable and its type or value is called A- Address B- scope C- value JT binding "7. ‘operator symbols to operations occurs at time "ane ee ac © tink D- run 18. The disadvantage of implicit declarations is. A> writability B= reliability C- readability D- otherwise 19. The advantage of static variables is AX efficiency B-flexibility C- reliability D-otherwise 20. The disadvantage of Implicit heap-dynamic variables is CZ maiteency B- reliability C- readability D- fesibitty 2 ~ language allows access to hidden variables, A-Cr+ ADA C Pascal =D-JAVA 22. The ....data type is almost always an exact reflection of the hardware A string D Aad C-float D-Bandc 23.4. = langage supports the decimal data type 29-Java language has ...... primitive ordinal types. A-2 363 C-4 D-5 r ‘ordinal data types aid to... A- reliability B- readability C- writability D-Otherwise 31. The index of arrays in Fortran language is .... data type. ae weve B- enumeration C- character D-B and C Binding of subscript ranges and storage allocation is dynamic and can change any number of times i Suez Canal University ip. ~y Faculty of Computers and Informatics Department of Computer Science is the colle« mn of the attributes of a variable. “descriptor B-datatype C-scope D- otherwise language support a complex type A-COBOL B- Pascal C- Java 6 Python . The advantage of using Boolean data type as primitive data type is .... A-writability B- reliability readability D- simplicity . The Character String data type is primitive via the String class in .... Language A-SNOBOL4 B- PERL (C)Java_D- C++ . Language supports all three character string length options A- Sting Ada C-Perl —_D- Fortran ). Enumeration fype aids to ...... B-Flexibility B- writability C- Orthogonality YY weadabilty stion [2]: TRUE/FALSE [25 marks} 1. The positional parameters in functions means that the name of the formal parameter to which an actual parameter is to be bound is specified with the actual parameter 2. In C++, default parameters must appear last because parameters are keyword associated. [> 3. Procedures structurally resemble functions but are semantically modeled on mathematical , functions. 14. The number of Semantic Models of Parameter Passing equals four. 45.Using in mode, The value of the actual parameter is used to initialize the corresponding formal parameter. 46. When a parameter is passed by result, no value is transmitted to the subprogram, | _ 41.Pass-by-Reference is inout Mode and is inefficient. A8.All parameters of methods in Java language are passed by reference. ie 79. All semantic modes are used in Ada language. | Pater are three types of Referencing Environment when parameters of functions are subprogram Names. -T binding of parameters, which are subprogram names, is the environment of the call statement enacts the passed subprogram. —y Overloaded functions can have the same parameters in Ada language because the return type ‘an overloaded function can be used to disambiguate calls. | Page 3 of 6 x ograms type. \ 4 subprograms need closures. the point just before pe except subpr neste: ing, but subsequent calls enter a & 53. Ada subprograms can return any 1 E54. a static-scoped language that does Not permit Bs ris fe cerome of « coroutine ist» is Dee the last eraouied statorsent in the ooroUne. | 56.In Java and C#, only widening assignment coe! @G@Frin 1950's, all algorithms represented by flowchi rcions are done. “\ rte ean be coded with only two-way selection and pretest | logical loops: (QB A control structure consists of three parts. “The controLexpression can in Python la » =I languages while PROLOG is one of the imperative language nae wre of the Function: 1. If the conext ofthe appearance of 8 variable determines its type, this is called type inferenc' | ZZ Ag wo variable names can be used to access the same memory Tocation, they are called aliasing- { allocation and deallocation caused by assignment statements, this is called Implicit heap-dynamic. ot The range of statements over which itis visible is called referencing environments. = having a farther variable with the same name- e be hidden from a unit by Tanguage includes namespaces. == ‘A. Given the following C code: 1, int calc (int *p) { 2.*p = 50; 3. return 30; ed) +/, -void main() { 6. x=100; 7.x = x + calc(&x); 8.} /* end of main */ 67.1F C language is left-associative, x= 130. “7 68.1f C language is right-associative, x = 150. B. Consider the following C program: void fun(void) { int @, b, c; /* definition 1 */ CMe i 8 ¢, Ai definition 2 */ d, e; /* definition 3 */ Canal University Faculty of Computers and Informatics Department of Computer Science ‘The visible variables, along with the number of the definition statement that defines it as follows: 69. Point 1: a:1, b:1, ¢:1, 4:2, = 70. Point 2: a:1, e3 4 71. Point 3: a:1,b:2, 72. Point 4: a:1, b:1, c:1 C. Consider the following Python program: Page 5 of 6 a) o ; List all the variables, along with the program units where they are declared, that are visible in the bodies of sub1, sub2 and sub3 assuming static scoping is used. in), y = = = (subi); int 1; x= s(main), y= 9 (Subs), z= 13(subt) -a = 7 73- point ¢ = 16(sub2), a = 13(sub2), y = 9(sub1); 74. point 2: x =15(sub2), ; w=17(sub2); 1(sub3), a = 19(sub1), 2 = 23(sub3), 75. point 3 : x= 15(sub2), i 236 Zo(sub3), a = 19(sub1), z = 23(sub3), w = 17(sub 2); 76.point 4: x= 15(sub2), . Consider the following program, writen in JavaScript-like syntax: #/ main program } function sub2() {+ var a, by 27 } function sub3() { var a, X, Wi 1 E. Given the following calling sequences and assuming dynamic scoping is used: . if main calls subs; sub1 calls sub2; sub2 calls subg then xwin subg. b,z in sub2, y in subi calls subi; subi calls subg then w in subg, yz in sub1. calls subg; sub2 calls subg; subg calls subs then in subi, xwin subg, b in suba. calls sub3; subg calls sub1, then z in subi; win subg With my best wishes, Dr Osama Helmy

You might also like