Software construction

1- Write a report on the evolution of programming languages. Pick one of your favorite programming language and evaluate it against other popular programming languages of the time. Your evaluation metrics should be based on readability, writability, reliability and cost. You can also include more metrics such as generality, efficiency and portability etc. The report should include: a. History of popular languages b. Evolution of popular languages c. Your evaluation matrix d. Evaluation of your chosen language based on evaluation metrics You can include code samples, graphical representations and other convincing means to defend your choice of language.
2- What is left factoring ? explain the limitation of left factoring? 3- LL parsers: for the following grammar S —> Ab$ A —> (bAb) A —> (Ab) a. Find first and follow b. Construct LL(1) parse table based on your predict sets c. Is this an LL(1) grammar? Why or why not?

4- Show a complete LR(0) parse, including the canonical collection of LR(0), parsing table and parse stack contents for the input string id * (id + id), using the following grammar E–>E+TIT T—>T*FIF F —> ( E ) l id
5- Show that the following grammar is SLR(1) but not LL(1) S–>SAIA A –> a
6- For the following given grammar : E—>(E+E)Ix
a. Draw canonical function of LR(0) b. Draw the LR(0) parsing table c. Check weather the input string ( ( x + x) + x ) generate by this grammar or not.
7- What are the motivations to use concurrent machines?
8- Define the following terms: a. Task, describe the five different states in which a task can be. b. synchronization c. competition and cooperation synchronization, d. liveness e. deadlock.
9- Define semaphore, then explain the following a. Counting semaphore b. Guard in a semaphore c. Binary semaphore

10- What does the following Java methods do: a. Yield b. Join c. Sleep
11- Describe the actions of the three Java methods (wait, notify, and notifyAll) that are used to support cooperation synchronization.
12- How is deadlock related to liveness?
13- Suppose two tasks, A and B, must use the shared variable Buf_Size. Task A adds 2 to Buf_Size and task B subtracts 1 from it. Assume that such arithmetic operations are done by the three-step process of fetching the current value, performing the arithmetic, and putting the new value back. In the absence of competition synchronization, what sequences of events are possible and what values result from these operations? Assume that the initial value of Buf_Size is 6.
14- Program question: Define semaphores in Ada and use them to provide both cooperation and competition synchronization in the shared-buffer.
15- Program question: The reader-writer problem can be stated as follows: A shared memory location can be concurrently read by any number of tasks, but when a task must write to the shared memory location, it must have exclusive access. Write a Java program for the reader-writer problem.
16- Generate code for simple languages and protocols using Lex and Yacc tools. a. Explain the steps of designing your code. b. Check the validity of your code specifications c. Attach your codes and screenshots of the results

 

 

 

Sample Solution

ACED ESSAYS