CSCI 305 Homework 1 Due Date: February 9, 2018 @ Beginning of Class
Name:
History Instruction: Select the single best answer (unless directed otherwise by the question) which answers the question. 1. What is the name of the paradigm that is based on formal logic and expresses facts and rules about some problem domain? (1 pt) a. functional b. concurrent c. logic d. non-deterministic e. metaprogramming f. object-oriented g. declarative h. imperative
2. What is the name of the paradigm that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data? (1 pt) a. event-driven b. concurrent c. scripting d. object-oriented e. logic f. imperative g. declarative h. functional i. metaprogramming j. non-deterministic
3. What language was the first to introduce some object-oriented concepts (but is not a fully object-oriented language)? (1 pt) a. COBOL b. LISP c. Fortran d. Simula e. Smalltalk f. PL/I g. Ada h. Algol i. BASIC j. C
4. What language is considered to be the first fully object-oriented language? (1 pt) a. Smalltalk b. C c. BASIC d. Simula e. Algol f. PL/I g. Fortran h. Ada i. COBOL j. LISP
5. Research "typeless language". Select ALL from the below that are DISadvantages of a typeless language (2 pts) a. It is often useful for very low-level languages used for systems programming b. it provides great flexibility for the programmer. c. Programmers can make changes to existing code in less time. d. Type checking is impossible; it is the programmer's responsibility to ensure that expressions and assignments are correct. e. Reading the code of another person may be more difficult. f. Such a language is easier to learn as a first programming language. g. It leads to an increase in the possibility of run-time errors. h. It results in poor reliability in type conversion and checking.
Grammar and Syntax 1. Construct a BNF grammar for each of the following languages. For example, a correct answer for "the set of all strings consisting of zero or more concatenated copies of the string ab " would be: ::= ab |
a. The set of all strings consisting of the keyword begin , followed by one or more statements with a semicolon after each one, followed by the keyword end . Use the non-terminal for statements, and do not give productions for it. (2 pts)
b. The set of all strings consisting of an open bracket (the symbol [ ) followed by a list of one or more digits separated by commas, followed by a closing bracket (the symbol ] ). (2 pts)
2. Construct an EBNF grammar for each of the languages in Grammars Question 1. Use the EBNF extensions wherever possible to simplify the grammars. In particular, you should eliminate explicit recursion form the grammars wherever possible. Don't forget to put single quotes around any EBNF metasymbol when using it as a token. a. (2 pts)
b. (2 pts)
3. Construct a syntax diagram for each of the languages in Grammars Question 1. Use branching and loops in your syntax diagrams to make them as clear as possible. a. (3 pts)
Feb 9, 2018 - 2. What is the name of the paradigm that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data? (1 pt) a. event-driven b. concurrent c. scripting d. object-oriented e. logic f. imperative g. declarative h. functional i. metaprogramming j. non-deterministic. 3.
Feb 23, 2018 - Describe how Fortran common blocks work and give an example. What happens if two named common blocks with the same name contain different variables? What is the difference between a blank common and a named common? What does the linker
Apr 16, 2018 - The following code fragment uses arrays in Java. The first line declares and allocates an array of two integers. The next two lines initialize it. int[] A = new int[2];. A[0] = 0;. A[1] = 2; f(A[0], A[A[0]]);. Function f is defined as:
Please select either bus 2 or 3 as reference bus, calculate the line flows, and check if the results are the same. 2. Come up with a case study of LP, and solve it in ...
region containing a constant magnetic field B = 2.6T aligned with the positive ... With what speed v did the particle enter the region containing the magnetic field?
May 14, 2015 - (Integer) Number indicating scheduling algorithm. 27 int policy;. 28. // Enum values for policy. 29 const short FCFS=0, SJF=1, PRIOR=2, RR=3;.
Dec 2, 2014 - In order to determine y-component of E-vector, we need to use right-hand rule, which will give us negative sign and for the size we will have.
Question 3. As you have learnt, a number of hosts using Ethernet, share a single channel and each collision decreases throughput. If hosts on a 6-host 10Mbps 80m Ethernet LAN send frames 64byte long, a. what is the scenario that maximizes throughput
are constantly accelerated by an electric field in the direction of the cathode, the num- ...... als, a standard fit software written at the University of Illinois [Beechem et al., 1991], ...... Technical report, International Computer Science Instit
(where these operators are the ordinary Killing vectors, denoted by fµ = ϵM fM. µ in class.) Comment 1: The deeper reason for this minus sign follows from the ...
Mar 4, 2002 - is now an integral part of computer science curricula. ...... students have one major department in which they are working OIl their degree.
Apr 27, 2014 - Developing scalable applications with IBM MQ Light and ... Improving the sample application by separating the web-facing component from the.
describing the group, one can encompass the transformations and their corresponding sym- metries. In fact, every symmetry has an associated group encompassing it. To make this discussion concrete, let's consider an example first and then delve into t