1 / 33

335 Review Game 1

335 Review Game 1. Teams. James, George, Becca , Alex Daniels Asher, Rex, Peter D, Colin Josh, Emily, Nick, Chad Emma, Alex Dawson, Jacopo, Peter T Heather, Brian, Matt, Eric Evan , Ryan, Todd, Sam. Individual round. 1. Describe Java in terms of: Generation? Paradigm?. 2.

jereni
Download Presentation

335 Review Game 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 335 Review Game 1

  2. Teams • James, George, Becca, Alex Daniels • Asher, Rex, Peter D, Colin • Josh, Emily, Nick, Chad • Emma, Alex Dawson, Jacopo, Peter T • Heather, Brian, Matt, Eric • Evan, Ryan, Todd, Sam

  3. Individual round

  4. 1. • Describe Java in terms of: • Generation? • Paradigm?

  5. 2. • Describe Java in terms of: - Declarative/Procedural? - Compiled/ Interpreted?

  6. 3. • Describe Python in terms of: • Generation? • Paradigm?

  7. 4. • Describe Python in terms of: - Declarative/Procedural? - Compiled/ Interpreted?

  8. 5. • What is reflection?

  9. 6. • What does it mean to say a variable is hidden?

  10. 7. • What kind of data structure is the symbol table?

  11. 8. • What does it mean for a language to be statically scoped?

  12. 9. Is it deterministic? Finite? What language?

  13. 10. • Give a pro and a con of a language offering reflection.

  14. 11. • What is forward-referencing?

  15. 12. • What makes a language regular?

  16. 13. • What are the 2 ways to make an automaton non-deterministic?

  17. 14. • Give a pro and a con for a language being very high level.

  18. 15. • What does it print? s = “Hello” print s[:2]

  19. 16. • What is the difference? x = [] y = {}

  20. 17. If L1 = {abn, n> 0} and L2 = {anb2n, n>0} what is L1 intersect L2?

  21. 18. • If L1 = {abn, n> 0} what is L1*?

  22. 19. What does it do? def mystery(lst): sec = 0 for x in lst: sec += len(x) return sec

  23. 20. NFA or DFA? Give 2 strings NOT in the language.

  24. 21. • Name the kind of problem where Java would be a better choice of language than Python

  25. 22. • For this code, tell what generation it is and what paradigm it belongs to. parent(X,Y) if mom(X,Y) or dad(X,Y). grandParent(X,Y) if parent(X,Z) and parent(Z,Y). mom(sue, sally).

  26. 23. • Give an example of a program that cannot be written without reflection.

  27. 24. • In Java reflection, what is a field?

  28. 25. • What is a scripting language?

  29. 26. • For this code, tell what generation it is and whether it is declarative or procedural. ADD(R1, 3)MUL(R1, 5) STO(R1,2032)

  30. All-Play

  31. int a = 2 • int b = 1 • Main(): • a=3 • b=7 • int x = 10 • A(x) • A(x): • int a = -3 • Print x • B(x) • B(x): • Print a What is the symbol table on line 13 if there is static scoping? If Main calls A which calls B, & there’s dynamic scoping, what is symbol table on line 13?

  32. Write the automata • Draw an automaton for the language of all strings on {a,b}* that start with aa but do NOT contain the substring bb.

  33. Write a Python method that takes a list of strings called lst and makes a dictionary where the keys are the lengths of the words and the values are the words themselves • lst = [“yeah”, “this”, “rocks”] • {4:[“yeah”, “this”], 5:[“rocks”]}

More Related