Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Proglan Finals Trans Term SY 2014-15 Ronald L. Ramos Name: __Jeric Paolo V. Arimado__ Student Number: __11083263__ Course:__BS-IS__ Answer the following questions as best as you can. Save the file as “Proglan Finals TransTerm SY2011415 – yourfullname.doc” When done upload the document to your wikifolder and update your wiki page. The following will merit an automatic zero in the exam: 1. Plagiarizing answers 2. Copying from a classmate/seatmate 3. Opening facebook or any form of social media 4. Talking to a classmate/seatmate during the exam Open notes. Open Internet. Closed Social Media sites. Good luck and Godspeed! HASKELL Answer in 3 sentences or less (3 points each): 1. Define functional programming in your own words. a. Functional programming is a programming paradigm in which computations are treated as the evaluations of mathematical expressions. It avoids changing state and using mutable data. For that reason, it always returns the same output for a given input. 2. What are the benefits of functional programming? a. Functional programming can lead to more concise code that is easier to understand. As such, it leads to increased developer productivity. 3. What is a monad in your own words? a. Monad defines computations as a series of steps in order to control the flow of data. 4. What are the differences between functional and imperative languages in your own words? a. In functional programming, you don’t tell how the computer must perform an evaluation. In imperative programming, you tell the computer how to evaluate by giving it a series of steps. 5. Define imperative programming in your own words. a. Imperative programming is a programming paradigm that defines a sequence of steps/instructions to perform. Given this list: list = [2,4,6,8,10] Using an online Haskell compiler give the commands needed to do the following. Take a screen shot of your running code and paste it as an answer to each question. (5 points each): 1. Extract the first element of a list 2. Display the entire list 3. Display HOW MANY elements the list has 4. Reverse the order of elements 5. Display the minimum item in the list Ruby Using an online Ruby compiler write the code asked for in each situation. Take a screen shot of your code and paste it as the answer (5 points each): 1. Simple for loop using a range from 1 to 10 2. Display each item in the following list: [ 5, 12, 'cronuts', 18.45, ‘Voltron’, ‘Lego’ ] . 3. Go through the valid values of an array called listahan. 4. Define a Ruby function/method called cube that gives the cube value of a number 5. Reverse the string “Lego” to “ogeL” 6. Print out the length of the string “Mississippi” 7. Concatenate two strings together 8. Print each letter from z to a 9. Print each number from 1 to 25 Answer in 2 sentences or less (3 points each): 1. What is Ruby on Rails? a. It is a web application framework for Ruby. 2. Cite one characteristic of Ruby and explain that feature. a. Ruby is dynamically typed. The type of the variable can change on the fly and at the exact moment it is processed by the interpreter. 3. Why did Matz create Ruby? a. Matz wanted to create an object-oriented scripting language that suited his needs. 4. Who is Matz (answers with “He created Ruby” will not be accepted)? a. Matz is a Japanese computer scientist known as the chief designer of Ruby. He is presently the Chief Architect of Ruby at Heroku. 5. Is Ruby and Ruby on Rails the same? Why or why not? a. Ruby and Ruby on Rails are not the same because the former is a programming language and the latter is a framework that uses the Ruby language. Bonus (Optional – each answer must have a minimum of one paragraph with at least 3 sentences per paragraph) 1. (5 points) Cite two characteristics of a good programming language and explain each characteristic in your own words. a. A good language should follow the current state of technology and be updated accordingly. This goes for the compiler implementations as well. Outdated technology is difficult to use and maintain, which in turn impedes developer productivity and system quality. Subsequently, the benefits that new technology brings in may not be harnessed properly by outdated technology. b. A good language must encourage the use of good practices in software engineering with great emphasis on ensuring a secure and reliable operation. With that in mind, it must also have a strong set of tools and environment that can support it so that developer productivity and system quality are not hampered. It should also have a standardized definition that is not tied to a specific platform, and its compiler implementations must adhere strictly to the standards. 2. (5 points) What 3 learnings will you take away from ProgLan. /rlr12162013 AMDG. Success is not final, failure is not fatal: it is the courage to continue that counts. - Winston Churchill