Guest User

Untitled

a guest
Oct 5th, 2016
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.49 KB | None | 0 0
  1. Please complete this assignment on your own and submit it as pdf.
  2. 1. (20 pts)
  3. Download, install Python and C#
  4. Run a “hello world” program in Python and C#
  5. Include the screenshots of your programs.
  6. Tips: You can download VMWare and Ubuntu to setup/run Python in a Linux environment. For C#, you can download Visual Studio to run your program in a .NET environment.
  7. 2. What is the disadvantage of having too many features in a language? (10 pts)
  8. 3. Why is readability important to writability? (5 pts)
  9. 4. What are three general methods of implementing a programming language? Explain them briefly with your own words. (10 pts)
  10. 5. Java uses a right brace to mark the end of all compound statements. What are the arguments for and against this design? (10 pts)
  11. 6. Describe the advantages and disadvantages of some programming environment you have used. (10 pts)
  12. 7. What is one example of a lack of orthogonality in the design of C? Explain it with your own words. (10 pts)
  13. 8.
  14. 1. What programming language has dominated scientific computing over the past 60 years? (1 pts)
  15. 2. What programming language has dominated business applications over the past 60 years? (1 pts)
  16. 3. What programming language has dominated artificial intelligence over the past 60 years? (1 pts)
  17. 4. In what language is most of UNIX written? (1 pts)
  18. 9. What arguments can you make for the idea of a single language for all programming domains? (10 pts)
  19. 10. Why is the von Neumann bottleneck important? (10 pts)
  20.  
  21.  
  22. Please complete this assignment on your own and submit it as pdf.
  23. 1- How does the typing system of PHP and JavaScript differ from that of Java? (10 pts)
  24. 2- Why does C++ include the features of C that are known to be unsafe? (10 pts)
  25. 3- What are the arguments both for and against the idea of a typeless language? (10 pts)
  26. 4- Make an educated guess as to the most common syntax error in Lisp. (10 pts)
  27. 5- Write a BNF grammar for the language of University of Memphis course codes. (20 pts)
  28. Example course codes:
  29. COMP 4040
  30. COMP 4060
  31. MAT 2354
  32. PHY 4583
  33. 6- Using C#, declare two variables of type string and give them values "Hello" and "World". Assign the value obtained by the concatenation of the two variables of type string (do not miss the space in the middle) to a variable of type object. Declare a third variable of type string and initialize it with the value of the variable of type object (you should use type casting). (10 pts)
  34. 7- Write a C# program, which compares correctly two real numbers with accuracy at least 0.000001. (10 pts)
  35. 8- Using C#, write a console program which accepts your name, city, age and UofM number. You should store all the values in the appropriate variable and then print all the information in correct format. (20 pts)
  36.  
  37. (20 pts)
  38. 1. Download antlr4 and install it on your computer. Run the Hello example in https://github.com/antlr/antlr4/blob/master/doc/getting-started.md
  39. The Hello grammar example should include Hello and your name. For example: Hello John. You should pop up that parse tree window as well as part of the answer of this question.
  40.  
  41. (20 pts)
  42. 2. Write a grammar for the language consisting of strings that have n coppies of the letter a followed by the same number of copies of the letter b, where n > 0. For example, the strings ab, aaaabbbb, and aaaaaaaabbbbbbbb are in the language but a, abb, ba, and aaabb are not.
  43.  
  44. (20 pts)
  45. 3. Draw parse trees for the sentences aabb, aaaabbbb, as derived from the grammar in the question 2.
  46.  
  47. (20 pts)
  48. 4. Prove that the following grammar is ambigous:
  49. <S> -> <A>
  50. <A>-> <A> + <A> | <id>
  51. <id> -> a | b| c
  52.  
  53. (20 pts)
  54. 5.Convert the BNF of the example below to EBNF.
  55. <assign> -> <id> = <expr>
  56. <id> -> A | B | C
  57. <expr> -> <expr> + <expr>
  58. | <expr> * <expr>
  59. | ( <expr> )
  60. | <id>
  61.  
  62.  
  63. Please do it on your own and submit it as pdf (include the source codes and screenshots of your program outputs).
  64. 1.Using C#, implement a console application of the source code of a lexical analyzer (front.c) on page 166 in the textbook. Your console application should receive an input (for example sum + 56/total) and give the similar output like on page 171. (50 pts)
  65. 2.Design a state diagram to recognize one form of the comments of the C-based programming languages, those that begin with /* and end with */. (20 pts)
  66. 3.Implement the problem in question 2 using C# code. (20 pts)
  67. 4.Show a trace of the recursive descent parser given in Section 4.4.1 for the string a + b * c. (10 pts)
Advertisement
Add Comment
Please, Sign In to add comment